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

Fix trace context in event payload #2205

Merged
merged 13 commits into from
Jun 28, 2023
Merged

Conversation

antonpirker
Copy link
Member

@antonpirker antonpirker commented Jun 27, 2023

Make sure that always a trace context is added to the event payload. But also make sure that if there is already a trace context in the event, do not overwrite it. (This used to be the behavior before tracing without performance. See: https://github.com/getsentry/sentry-python/blob/1.25.1/sentry_sdk/scope.py#L420)

Fixes #2201

@antonpirker antonpirker changed the base branch from master to antonpirker/trace-meta-base June 27, 2023 12:42
Base automatically changed from antonpirker/trace-meta-base to master June 28, 2023 08:09
Copy link
Contributor

@sentrivana sentrivana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, please consider the small suggestion and comment

sentry_sdk/scope.py Outdated Show resolved Hide resolved
Co-authored-by: Ivana Kellyerova <[email protected]>
@antonpirker
Copy link
Member Author

We also have spans present if tracing is disabled, so the check needs to be there.

@antonpirker
Copy link
Member Author

Thanks for the better if, way nicer to read

@antonpirker antonpirker merged commit 6795295 into master Jun 28, 2023
@antonpirker antonpirker deleted the antonpirker/fix-trace-id2 branch June 28, 2023 13:31
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.

[TwP] Fallback to propagation context if span is None
2 participants