@@ -43,49 +43,6 @@ export function extractTraceparentData(traceparent?: string): TraceparentData |
4343 } ;
4444}
4545
46- /**
47- * Create tracing context from incoming headers.
48- *
49- * @deprecated Use `propagationContextFromHeaders` instead.
50- */
51- // TODO(v8): Remove this function
52- export function tracingContextFromHeaders (
53- sentryTrace : Parameters < typeof extractTraceparentData > [ 0 ] ,
54- baggage : Parameters < typeof baggageHeaderToDynamicSamplingContext > [ 0 ] ,
55- ) : {
56- traceparentData : ReturnType < typeof extractTraceparentData > ;
57- dynamicSamplingContext : ReturnType < typeof baggageHeaderToDynamicSamplingContext > ;
58- propagationContext : PropagationContext ;
59- } {
60- const traceparentData = extractTraceparentData ( sentryTrace ) ;
61- const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext ( baggage ) ;
62-
63- const { traceId, parentSpanId, parentSampled } = traceparentData || { } ;
64-
65- if ( ! traceparentData ) {
66- return {
67- traceparentData,
68- dynamicSamplingContext : undefined ,
69- propagationContext : {
70- traceId : traceId || uuid4 ( ) ,
71- spanId : uuid4 ( ) . substring ( 16 ) ,
72- } ,
73- } ;
74- } else {
75- return {
76- traceparentData,
77- dynamicSamplingContext : dynamicSamplingContext || { } , // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it
78- propagationContext : {
79- traceId : traceId || uuid4 ( ) ,
80- parentSpanId : parentSpanId || uuid4 ( ) . substring ( 16 ) ,
81- spanId : uuid4 ( ) . substring ( 16 ) ,
82- sampled : parentSampled ,
83- dsc : dynamicSamplingContext || { } , // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it
84- } ,
85- } ;
86- }
87- }
88-
8946/**
9047 * Create a propagation context from incoming headers.
9148 */
0 commit comments