Skip to content

Commit c5b580c

Browse files
cleptricbitsandfoxes
authored andcommitted
Update dynamic-sampling-context.mdx (#13920)
1 parent 39aab18 commit c5b580c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

develop-docs/sdk/telemetry/traces/dynamic-sampling-context.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Any values on the DSC should be propagated "as is" - this includes values like "
171171
SDKs should recognize incoming requests as "instrumented" or "traced" when at least one of the following applies:
172172

173173
- The incoming request has a `sentry-trace` header
174-
- The incoming request has a `baggage` header containing one or more keys starting with "`sentry-`"
174+
- The incoming request has a `sentry-trace` header and `baggage` header containing one or more keys starting with "`sentry-`"
175175

176176
After the DSC of a particular trace has been frozen, API calls like `set_user` should have no effect on the DSC.
177177

@@ -193,7 +193,7 @@ def on_incoming_request(request):
193193
# Request comes from an old SDK which doesn't support Dynamic Sampling Context yet
194194
# --> we don't propagate baggage for this trace
195195
current_transaction.dynamic_sampling_context_frozen = True
196-
elif request.has_header("baggage") and has_sentry_value_in_baggage_header(request):
196+
elif request.has_header("sentry-trace") and request.has_header("baggage") and has_sentry_value_in_baggage_header(request):
197197
current_transaction.dynamic_sampling_context_frozen = True
198198
current_transaction.dynamic_sampling_context = baggage_header_to_dict(request.headers.baggage)
199199

0 commit comments

Comments
 (0)