Skip to content

Commit e70507e

Browse files
committed
client check
1 parent 78023e3 commit e70507e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/opentelemetry/src/propagator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,13 @@ function getContextWithRemoteActiveSpan(
213213
const propagationContext = propagationContextFromHeaders(sentryTrace, baggage);
214214

215215
const { traceId, parentSpanId, sampled, dsc } = propagationContext;
216+
217+
const client = getClient();
216218
const incomingDsc = baggageHeaderToDynamicSamplingContext(baggage);
217219

218220
// We only want to set the virtual span if we are continuing a concrete trace
219221
// Otherwise, we ignore the incoming trace here, e.g. if we have no trace headers
220-
if (!parentSpanId || !shouldContinueTrace(getClient(), incomingDsc?.org_id)) {
222+
if (!parentSpanId || (client && !shouldContinueTrace(client, incomingDsc?.org_id))) {
221223
return ctx;
222224
}
223225

0 commit comments

Comments
 (0)