-
Notifications
You must be signed in to change notification settings - Fork 1
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
capture user/org tags in sentry #449
Conversation
commcare_connect/utils/middleware.py
Outdated
def process_view(self, request, view_func, view_args, view_kwargs): | ||
from sentry_sdk import configure_scope | ||
|
||
with configure_scope() as scope: |
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.
Why use this pattern instead of the one shown in the docs using get_current_scope
or just sentry_sdk.set_tag
? Is there a difference between them. I can't actually find this one in the docs.
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.
On further look, it looks like this function is deprecated https://docs.sentry.io/platforms/python/migration/1.x-to-2.x#custom-instrumentation
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.
I have updated it to use set_user and set_tag. (Previously I adapted this from HQ which was using 2.8 )
@calellowitz Does this look good now? |
This should make it easy to trace 500s when users report issues.