Skip to content

Adds trace_propagation_targets option#1916

Merged
antonpirker merged 31 commits into
masterfrom
antonpirker/1785_trace_propagation_targets
Feb 27, 2023
Merged

Adds trace_propagation_targets option#1916
antonpirker merged 31 commits into
masterfrom
antonpirker/1785_trace_propagation_targets

Conversation

@antonpirker

@antonpirker antonpirker commented Feb 21, 2023

Copy link
Copy Markdown
Contributor

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
Comment thread sentry_sdk/integrations/httpx.py
Comment thread sentry_sdk/integrations/httpx.py Outdated
Comment thread sentry_sdk/tracing_utils.py Outdated
@cleptric

Copy link
Copy Markdown
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
Copy Markdown
Contributor 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.

Comment thread sentry_sdk/integrations/httpx.py Outdated
Comment thread sentry_sdk/integrations/httpx.py Outdated
@antonpirker

Copy link
Copy Markdown
Contributor Author

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

@sl0thentr0py sl0thentr0py left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

one typing comment

Comment thread sentry_sdk/consts.py Outdated
@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