Skip to content

Commit 339b7e0

Browse files
POTEL 62 - Build PropagationContext from sampling decision (#3947)
* bump OTel to 2.10.0 * support DB_QUERY_TEXT * changelog * change bom version for otel * Replace OTel ContextStorage wrapper with ContextStorageProvider * bump spring boot 3.4 * fix twp * Use null sampled for TwP * make todo url configurable * Build PropagationContext from sampling decision in OTel instead of incoming headers * Format code * changelog * Revert "make todo url configurable" This reverts commit a90f316. --------- Co-authored-by: Sentry Github Bot <[email protected]>
1 parent e08357c commit 339b7e0

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- When generating `sentry-trace` header from `PropagationContext` we now copy the `sampled` flag.
1010
- 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`
1111
- 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))
12+
- 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))
1213

1314
## 8.0.0-rc.1
1415

sentry-opentelemetry/sentry-opentelemetry-core/src/main/java/io/sentry/opentelemetry/OtelSentrySpanProcessor.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,8 @@ public void onStart(final @NotNull Context parentContext, final @NotNull ReadWri
8484
final @Nullable Boolean sampled = isSampled(otelSpan, samplingDecision);
8585

8686
final @NotNull PropagationContext propagationContext =
87-
sentryTraceHeader == null
88-
? new PropagationContext(
89-
new SentryId(traceId), sentrySpanId, sentryParentSpanId, baggage, sampled)
90-
: PropagationContext.fromHeaders(sentryTraceHeader, baggage, sentrySpanId);
87+
new PropagationContext(
88+
new SentryId(traceId), sentrySpanId, sentryParentSpanId, baggage, sampled);
9189

9290
updatePropagationContext(scopes, propagationContext);
9391
}

0 commit comments

Comments
 (0)