diff --git a/packages/opentelemetry/src/propagator.ts b/packages/opentelemetry/src/propagator.ts index 7c7baf07328e..66f0624ed1de 100644 --- a/packages/opentelemetry/src/propagator.ts +++ b/packages/opentelemetry/src/propagator.ts @@ -198,7 +198,8 @@ export function getInjectionData(context: Context): { } { const span = trace.getSpan(context); - // If we have a remote span, we need to ensure to use the span as parentSpanId, not spanId itself + // If we have a remote span, the spanId should be considered as the parentSpanId, not spanId itself + // Instead, we use a virtual (generated) spanId for propagation if (span && span.spanContext().isRemote) { const spanContext = span.spanContext(); const dynamicSamplingContext = getDynamicSamplingContextFromSpan(span);