-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
chore: posthog and sentry exception capture #27836
Conversation
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
Size Change: -5 B (0%) Total Size: 1.16 MB ℹ️ View Unchanged
|
|
||
sentry_capture_exception(error, scope=sentry_scope, **sentry_scope_kwargs) | ||
|
||
if api_key: |
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.
Really don't like having to use this as the check but tests were failing otherwise. I tried using TEST
but didn't seem to work in CI. Try / catch was also possible but seemed like overkill
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.
Eh, I think we just take it (it's possible we should actually do this inside the call to capture? I'm not sure, no strong feeling)
|
||
sentry_capture_exception(error, scope=sentry_scope, **sentry_scope_kwargs) | ||
|
||
if api_key: |
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.
Eh, I think we just take it (it's possible we should actually do this inside the call to capture? I'm not sure, no strong feeling)
Problem
Realised we had not yet replaced manual exception capture with a wrapping function that sends data to both Sentry and PostHog
Changes
Replace
capture_exception
from Sentry with an equivalent method in theposthog.exceptions
module which also calls PostHog'scapture_exception
methodGiven we don't support the concept of scopes & tagging right now I just ignored them. It feels like our issues will have slightly less context as a result but capturing the exceptions is better than what we have right now