Closed as not planned
Description
TODO: We should also check whether push_scope
in 1.x is affected!
How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.0.0rc2
Steps to Reproduce
Run the following script:
import sentry_sdk
sentry_sdk.init("<dsn>")
with sentry_sdk.new_scope() as scope:
scope.set_tag("custom tag 1", "value 1")
1 / 0
Expected Result
The zero division error gets sent to Sentry, and the error event has the tag "custom tag 1" with the value "value 1" set.
Actual Result
Although the zero division error gets reported to Sentry, the error event is missing the tag. This is because the new_scope
method restores the original scope within a finally
block, which gets called before the scopes are merged and before the event is sent to Sentry. So, the scope that had the tag set is no longer active when the event is prepared for sending.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status