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

bug-1920739: update sentry_sdk to 2.17.0 #6778

Merged
merged 1 commit into from
Oct 31, 2024
Merged

Conversation

willkg
Copy link
Contributor

@willkg willkg commented Oct 31, 2024

This updates sentry_sdk to 2.17.0. In order to do that, we had to do two fundamental changes:

  1. Switch sentry_sdk.push_scope() calls to sentry_sdk.new_scope() which does roughly the same thing.

  2. Switch from using sentry_sdk.add_extra() to sentry_sdk.set_context(). add_extra() was nice in that it allowed us to add additional things to the sentry event payload that gave context to the error. We used this to capture the processor rule, ruleset, crash_id, signature generation rule, etc in an additive way.

    add_extra() is deprecated and Sentry suggests to switch to set_context() which is not an additive kind of thing. So now we have to set a new context section everywhere we set the context. That's a little annoying, but it'll be fine.

I updated the code and tests accordingly.

I verified that the final context for a sentry event looks correct. Here's a screenshot of the context section in Kent for an error kicked up by a signature generation rule:

2024-10-31_sentry_context

@willkg willkg requested a review from a team as a code owner October 31, 2024 13:13
This updates sentry_sdk to 2.17.0. In order to do that, we had to do two
fundamental changes:

1. Switch `sentry_sdk.push_scope()` calls to `sentry_sdk.new_scope()`
   which does roughly the same thing.
2. Switch from using `sentry_sdk.add_extra()` to
   `sentry_sdk.set_context()`. `add_extra()` was nice in that it allowed
   us to add additional things to the sentry event payload that gave
   context to the error. We used this to capture the processor rule,
   ruleset, crash_id, signature generation rule, etc in an additive way.

   `add_extra()` is deprecated and Sentry suggests to switch to
   `set_context()` which is not an additive kind of thing. So now we
   have to set a new context section everywhere we set the context.
   That's a little annoying, but it'll be fine.

I updated the code and tests accordingly.
@willkg willkg force-pushed the willkg-bug-1920739-sentry branch from 5965301 to 717740f Compare October 31, 2024 14:38
@willkg willkg added this pull request to the merge queue Oct 31, 2024
@willkg
Copy link
Contributor Author

willkg commented Oct 31, 2024

Thank you!

Merged via the queue into main with commit f60fb36 Oct 31, 2024
1 check passed
@willkg willkg deleted the willkg-bug-1920739-sentry branch October 31, 2024 15:14
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

Successfully merging this pull request may close these issues.

2 participants