-
-
Notifications
You must be signed in to change notification settings - Fork 21
O11y.SpanAttributes protocol isn't called for Tuples when setting attributes #154
Copy link
Copy link
Open
Description
I'm not sure here is the right repo, or O11y. But here what I tried:
@decorate trace("myapp.my_func", include: [:result])
### somwehere else:
defimpl O11y.SpanAttributes, for: Tuple do
def get(tuple) do
# ... it would generate [{"status", "ok"}] for {:ok, contents} tuple,
# ... or generate [{"status", "error"}, {"reason", "timeout"}] for {:error, :timeout} tuple
end
endI tested that, and it doesn't work because the O11y doesn't attempt to call O11y.SpanAttributes.get/1 for tuples, only for map or structs
In other words, I would like to give easy visibility when a function returned successfully or had an error based on the signal tuples we're using in our app. Ideally, we would like the tracer could intelligently understand it or the library user to extend the functionality to do it.
What do you think? Where is the best place for an extension like this? Or do you have a better recommendation?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels