Skip to content

Commit

Permalink
Create an empty DSC in case there is no baggage header (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric committed Dec 6, 2022
1 parent c63acf9 commit 1c273b2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tracing.go
Expand Up @@ -699,6 +699,13 @@ func ContinueFromHeaders(trace, baggage string) SpanOption {
if baggage != "" {
s.updateFromBaggage([]byte(baggage))
}
// In case a sentry-trace header is present but no baggage header,
// create an empty, frozen DynamicSamplingContext.
if trace != "" && baggage == "" {
s.dynamicSamplingContext = DynamicSamplingContext{
Frozen: true,
}
}
}
}

Expand Down

0 comments on commit 1c273b2

Please sign in to comment.