@@ -2,63 +2,28 @@ import type { Baggage, Context, Span, SpanContext, TextMapGetter, TextMapSetter
22import { INVALID_TRACEID , TraceFlags , context , propagation , trace } from '@opentelemetry/api' ;
33import { W3CBaggagePropagator , isTracingSuppressed } from '@opentelemetry/core' ;
44import { ATTR_URL_FULL , SEMATTRS_HTTP_URL } from '@opentelemetry/semantic-conventions' ;
5- import type { DynamicSamplingContext , Options , PropagationContext , continueTrace } from '@sentry/core' ;
5+ import type { DynamicSamplingContext , Options , continueTrace } from '@sentry/core' ;
66import {
77 LRUMap ,
88 SENTRY_BAGGAGE_KEY_PREFIX ,
9- baggageHeaderToDynamicSamplingContext ,
109 generateSentryTraceHeader ,
1110 getClient ,
1211 getCurrentScope ,
1312 getDynamicSamplingContextFromScope ,
1413 getDynamicSamplingContextFromSpan ,
1514 getIsolationScope ,
16- getRootSpan ,
1715 logger ,
1816 parseBaggageHeader ,
1917 propagationContextFromHeaders ,
2018 spanToJSON ,
2119 stringMatchesSomePattern ,
2220} from '@sentry/core' ;
23- import {
24- SENTRY_BAGGAGE_HEADER ,
25- SENTRY_TRACE_HEADER ,
26- SENTRY_TRACE_STATE_DSC ,
27- SENTRY_TRACE_STATE_URL ,
28- } from './constants' ;
21+ import { SENTRY_BAGGAGE_HEADER , SENTRY_TRACE_HEADER , SENTRY_TRACE_STATE_URL } from './constants' ;
2922import { DEBUG_BUILD } from './debug-build' ;
3023import { getScopesFromContext , setScopesOnContext } from './utils/contextData' ;
3124import { getSamplingDecision } from './utils/getSamplingDecision' ;
3225import { makeTraceState } from './utils/makeTraceState' ;
3326import { setIsSetup } from './utils/setupCheck' ;
34- import { spanHasParentId } from './utils/spanTypes' ;
35-
36- /**
37- * Get the Sentry propagation context from a span context.
38- * @deprecated This method is not used anymore and may be removed in a future major.
39- */
40- export function getPropagationContextFromSpan ( span : Span ) : PropagationContext {
41- const spanContext = span . spanContext ( ) ;
42- const { traceId, traceState } = spanContext ;
43-
44- // When we have a dsc trace state, it means this came from the incoming trace
45- // Then this takes presedence over the root span
46- const dscString = traceState ? traceState . get ( SENTRY_TRACE_STATE_DSC ) : undefined ;
47- const traceStateDsc = dscString ? baggageHeaderToDynamicSamplingContext ( dscString ) : undefined ;
48-
49- const parentSpanId = spanHasParentId ( span ) ? span . parentSpanId : undefined ;
50- const sampled = getSamplingDecision ( spanContext ) ;
51-
52- // No trace state? --> Take DSC from root span
53- const dsc = traceStateDsc || getDynamicSamplingContextFromSpan ( getRootSpan ( span ) ) ;
54-
55- return {
56- traceId,
57- sampled,
58- parentSpanId,
59- dsc,
60- } ;
61- }
6227
6328/**
6429 * Injects and extracts `sentry-trace` and `baggage` headers from carriers.
0 commit comments