File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
dev-packages/node-integration-tests/suites/tracing/meta-tags-twp-errors
packages/opentelemetry/src Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -41,11 +41,16 @@ describe('errors in TwP mode have same trace in trace context and getTraceData()
41
41
42
42
const traceData = contexts ?. traceData || { } ;
43
43
44
- expect ( traceData [ 'sentry-trace' ] ) . toEqual ( `${ trace_id } -${ span_id } ` ) ;
44
+ expect ( traceData [ 'sentry-trace' ] ) . toContain ( `${ trace_id } -` ) ;
45
+ // span_id is a random span ID
46
+ expect ( traceData [ 'sentry-trace' ] ) . not . toContain ( span_id ) ;
47
+
45
48
expect ( traceData . baggage ) . toContain ( `sentry-trace_id=${ trace_id } ` ) ;
46
49
expect ( traceData . baggage ) . not . toContain ( 'sentry-sampled=' ) ;
47
50
48
- expect ( traceData . metaTags ) . toContain ( `<meta name="sentry-trace" content="${ trace_id } -${ span_id } "/>` ) ;
51
+ expect ( traceData . metaTags ) . toContain ( `<meta name="sentry-trace" content="${ trace_id } -` ) ;
52
+ // span_id is a random span ID
53
+ expect ( traceData . metaTags ) . not . toContain ( span_id ) ;
49
54
expect ( traceData . metaTags ) . toContain ( `sentry-trace_id=${ trace_id } ` ) ;
50
55
expect ( traceData . metaTags ) . not . toContain ( 'sentry-sampled=' ) ;
51
56
} ,
Original file line number Diff line number Diff line change @@ -206,9 +206,7 @@ export function getInjectionData(context: Context): {
206
206
return {
207
207
dynamicSamplingContext,
208
208
traceId : spanContext . traceId ,
209
- // Because this is a remote span, we do not want to propagate this directly
210
- // As otherwise things may be attached "directly" to an unrelated span
211
- spanId : generateSpanId ( ) ,
209
+ spanId : undefined ,
212
210
sampled : getSamplingDecision ( spanContext ) ,
213
211
} ;
214
212
}
@@ -236,7 +234,7 @@ export function getInjectionData(context: Context): {
236
234
return {
237
235
dynamicSamplingContext,
238
236
traceId : propagationContext . traceId ,
239
- spanId : generateSpanId ( ) ,
237
+ spanId : undefined ,
240
238
sampled : propagationContext . sampled ,
241
239
} ;
242
240
}
You can’t perform that action at this time.
0 commit comments