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,7 +206,7 @@ export function getInjectionData(context: Context): {
206206 traceId : spanContext . traceId ,
207207 // Because this is a remote span, we do not want to propagate this directly
208208 // As otherwise things may be attached "directly" to an unrelated span
209- spanId : generateSpanId ( ) ,
209+ spanId : undefined ,
210210 sampled : getSamplingDecision ( spanContext ) ,
211211 } ;
212212 }
@@ -234,9 +234,7 @@ export function getInjectionData(context: Context): {
234234 return {
235235 dynamicSamplingContext,
236236 traceId : propagationContext . traceId ,
237- // TODO(v9): Use generateSpanId() instead
238- // eslint-disable-next-line deprecation/deprecation
239- spanId : propagationContext . spanId ,
237+ spanId : undefined ,
240238 sampled : propagationContext . sampled ,
241239 } ;
242240}
You can’t perform that action at this time.
0 commit comments