Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: with_event decorator #147

Open
ktayah opened this issue May 2, 2024 · 2 comments
Open

Feature Request: with_event decorator #147

ktayah opened this issue May 2, 2024 · 2 comments

Comments

@ktayah
Copy link

ktayah commented May 2, 2024

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 or with_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?

@marcdel
Copy link
Owner

marcdel commented May 23, 2024

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?

@ktayah
Copy link
Author

ktayah commented Jun 21, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants