@@ -93,6 +93,8 @@ export class SentryPropagator extends W3CBaggagePropagator {
93
93
const activeSpan = trace . getSpan ( context ) ;
94
94
const url = activeSpan && getCurrentURL ( activeSpan ) ;
95
95
96
+ console . log ( '1' , { activeSpan, url } ) ;
97
+
96
98
const tracePropagationTargets = getClient ( ) ?. getOptions ( ) ?. tracePropagationTargets ;
97
99
if (
98
100
typeof url === 'string' &&
@@ -104,6 +106,7 @@ export class SentryPropagator extends W3CBaggagePropagator {
104
106
'[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:' ,
105
107
url ,
106
108
) ;
109
+ console . log ( '2' , { tracePropagationTargets } ) ;
107
110
return ;
108
111
}
109
112
@@ -112,6 +115,7 @@ export class SentryPropagator extends W3CBaggagePropagator {
112
115
113
116
const { dynamicSamplingContext, traceId, spanId, sampled } = getInjectionData ( context ) ;
114
117
118
+ console . log ( '3' , { existingBaggageHeader, baggage, dynamicSamplingContext, traceId, spanId, sampled } ) ;
115
119
if ( existingBaggageHeader ) {
116
120
const baggageEntries = parseBaggageHeader ( existingBaggageHeader ) ;
117
121
@@ -120,6 +124,7 @@ export class SentryPropagator extends W3CBaggagePropagator {
120
124
baggage = baggage . setEntry ( key , { value } ) ;
121
125
} ) ;
122
126
}
127
+ console . log ( '4' , { baggageEntries, baggage } ) ;
123
128
}
124
129
125
130
if ( dynamicSamplingContext ) {
@@ -129,14 +134,17 @@ export class SentryPropagator extends W3CBaggagePropagator {
129
134
}
130
135
return b ;
131
136
} , baggage ) ;
137
+ console . log ( '5' , { dynamicSamplingContext, baggage } ) ;
132
138
}
133
139
134
140
// We also want to avoid setting the default OTEL trace ID, if we get that for whatever reason
135
141
if ( traceId && traceId !== INVALID_TRACEID ) {
136
142
setter . set ( carrier , SENTRY_TRACE_HEADER , generateSentryTraceHeader ( traceId , spanId , sampled ) ) ;
143
+ console . log ( '6' , { carrier, traceId, spanId, sampled } ) ;
137
144
}
138
145
139
146
super . inject ( propagation . setBaggage ( context , baggage ) , carrier , setter ) ;
147
+ console . log ( '7' , { carrier } ) ;
140
148
}
141
149
142
150
/**
@@ -198,7 +206,7 @@ function getInjectionData(context: Context): {
198
206
spanId : string | undefined ;
199
207
sampled : boolean | undefined ;
200
208
} {
201
- const span = hasTracingEnabled ( ) ? trace . getSpan ( context ) : undefined ;
209
+ const span = trace . getSpan ( context ) ;
202
210
const spanIsRemote = span ?. spanContext ( ) . isRemote ;
203
211
204
212
// If we have a local span, we can just pick everything from it
0 commit comments