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

POTEL 62 - Build PropagationContext from sampling decision #3947

Merged
merged 15 commits into from
Dec 5, 2024
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- When generating `sentry-trace` header from `PropagationContext` we now copy the `sampled` flag.
- In `TransactionContext.fromPropagationContext` when there is no parent sampling decision, keep the decision `null` so a new sampling decision is made instead of defaulting to `false`
- Defer sampling decision by setting `sampled` to `null` in `PropagationContext` when using OpenTelemetry in case of an incoming defer sampling `sentry-trace` header. ([#3945](https://github.com/getsentry/sentry-java/pull/3945))
- Build `PropagationContext` from `SamplingDecision` made by `SentrySampler` instead of parsing headers and potentially ignoring a sampling decision in case a `sentry-trace` header comes in with deferred sampling decision. ([#3947](https://github.com/getsentry/sentry-java/pull/3947))

## 8.0.0-rc.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@ public void onStart(final @NotNull Context parentContext, final @NotNull ReadWri
final @Nullable Boolean sampled = isSampled(otelSpan, samplingDecision);

final @NotNull PropagationContext propagationContext =
sentryTraceHeader == null
? new PropagationContext(
new SentryId(traceId), sentrySpanId, sentryParentSpanId, baggage, sampled)
: PropagationContext.fromHeaders(sentryTraceHeader, baggage, sentrySpanId);
new PropagationContext(
new SentryId(traceId), sentrySpanId, sentryParentSpanId, baggage, sampled);

updatePropagationContext(scopes, propagationContext);
}
Expand Down
Loading