-
Notifications
You must be signed in to change notification settings - Fork 50
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
Sentry interceptor example #23
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a couple of comments. Looks great!
Some other that I think would help:
- Add a README.md in this folder w/ details on how to run (see how OTel sample does it in OpenTelemetry sample #18)
- Add a "dependency group" for
sentry
inpyproject.toml
to add thesentry_sdk
dependency (see how OTel sample does it in OpenTelemetry sample #18) - Separate the
starter
from theworker
. We are doing this in all of the non-hello samples, and we do it in all SDKs, to emphasize that workers are often completely separate from starters (see how OTel sample does it in OpenTelemetry sample #18)
If the Sentry SDK comes with utilities to capture/assert output in a test, a test in tests/sentry
would be great. But not required or anything.
will try to implement the tests/readme/worker changes this weekend |
@nediamond - Wanted to follow up here. I think this is a great sample. Let me know if there's anything I can do to help move it along. |
@cretz sorry got busy with life stuff will set some time aside for this before next week - feel clear on what needs to be done thanks |
44186df
to
f7d6513
Compare
d8567f6
to
811b935
Compare
@cretz i reverted the added a super basic readme, but i think this is about as much as i can commit to for now |
Ok, I will look to fixing that and improving your README |
673ce72
to
c59a0f0
Compare
Hey @nediamond and @cretz, I just wanted to share a pitfall I found in this approach for implementing Sentry via interceptors when using threaded activities. Because activities are run in a thread in a My solution was to add Sentry handling to a custom decorator that wraps the I just wanted to write this up in case you had any further thoughts on this and as a note for others implementing Sentry with Temporal Python SDK. |
Hrmm, this is true. I think we need to be putting contextvars from interceptors on to threaded activities. I have opened temporalio/sdk-python#263. |
What was changed
added Sentry interceptor example based on discussion in slack thread
Why?
Sentry is a popular error monitoring tool & interceptors aren't super intuitive to make from scratch, hopefully this can be a good starting point for folks
Checklist
How was this tested:
Executed locally
Any docs updates needed?
not sure