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()
4141
4242 const traceData = contexts ?. traceData || { } ;
4343
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+
4548 expect ( traceData . baggage ) . toContain ( `sentry-trace_id=${ trace_id } ` ) ;
4649 expect ( traceData . baggage ) . not . toContain ( 'sentry-sampled=' ) ;
4750
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 ) ;
4954 expect ( traceData . metaTags ) . toContain ( `sentry-trace_id=${ trace_id } ` ) ;
5055 expect ( traceData . metaTags ) . not . toContain ( 'sentry-sampled=' ) ;
5156 } ,
Original file line number Diff line number Diff line change @@ -206,9 +206,7 @@ export function getInjectionData(context: Context): {
206206 return {
207207 dynamicSamplingContext,
208208 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 ,
212210 sampled : getSamplingDecision ( spanContext ) ,
213211 } ;
214212 }
@@ -236,7 +234,7 @@ export function getInjectionData(context: Context): {
236234 return {
237235 dynamicSamplingContext,
238236 traceId : propagationContext . traceId ,
239- spanId : generateSpanId ( ) ,
237+ spanId : undefined ,
240238 sampled : propagationContext . sampled ,
241239 } ;
242240}
You can’t perform that action at this time.
0 commit comments