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

Adds trace_propagation_targets option #1916

Merged
merged 31 commits into from
Feb 27, 2023

Conversation

antonpirker
Copy link
Member

@antonpirker antonpirker commented Feb 21, 2023

Add an option trace_propagation_targets that defines to what targets the trace headers (sentry-trace and baggage) are added in outgoing HTTP requests.

Spec is here: https://docs.sentry.io/platforms/node/guides/serverless-cloud/configuration/options/#trace-propagation-targets

Fixes #1785

@antonpirker antonpirker changed the title Adds 'trace_propagation_targets' option Adds trace_propagation_targets option Feb 21, 2023
@antonpirker antonpirker changed the base branch from master to antonppirker/update-httpx-testing February 21, 2023 13:44
Base automatically changed from antonppirker/update-httpx-testing to master February 21, 2023 14:17
@antonpirker antonpirker marked this pull request as ready for review February 21, 2023 14:29
sentry_sdk/tracing_utils.py Outdated Show resolved Hide resolved
@cleptric
Copy link
Member

Semantics for this option are defined here https://docs.sentry.io/platforms/node/guides/serverless-cloud/configuration/options/#trace-propagation-targets

@antonpirker
Copy link
Member Author

Now I changed the behavior to have a [MATCH_ALL] default that matches everything so traces are propagated everywhere. If it is set to [] or None then traces will not be propagated anywhere.

Matching is also done by substring like described in the linked develop docs.

sentry_sdk/integrations/httpx.py Outdated Show resolved Hide resolved
@antonpirker
Copy link
Member Author

I have now implemented @sl0thentr0py suggestion to fetch the options in the function. Now calling the function looks nicer.

Copy link
Member

@sl0thentr0py sl0thentr0py left a comment

Choose a reason for hiding this comment

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

one typing comment

sentry_sdk/consts.py Outdated Show resolved Hide resolved
@antonpirker antonpirker merged commit 04cfc86 into master Feb 27, 2023
@antonpirker antonpirker deleted the antonpirker/1785_trace_propagation_targets branch February 27, 2023 10:40
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.

Add trace_propagation_targets option.
4 participants