Open ktayah opened 4 months ago
Hey @ktayah I've made changes to o11y to support this feature and am workin on it now. The assumption I'm making (since this will wrap a function) is that the event should only be emitted if the function completes successfully. Does that seem reasonable?
@marcdel My thought was it emits when the function gets called. I imagine one could use the metadata from this event to help them debug their code. I don't have super strong feelings about this, maybe this is something the client of the library can decide.
What are the thoughts on adding a new decorator alongside the main
with_span
decorator that handles adding a span event?In our use of OpenTelemetry we noticed that we have some functions that we would like to trace, but only when it is called while in an already started span. We did not want to create a new span and introduce noise (in our situation). A
with_event
orwith_span_event
decorator that utilizes some of the same attribute parsing logic seems useful and makes sense to add into this library. I wouldn't mind implementing this as well.Thoughts?