File tree 2 files changed +12
-12
lines changed
2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 1
1
import type { Scope , TraceContext } from '@sentry/types' ;
2
2
import type { Client } from '@sentry/types' ;
3
- import { dropUndefinedKeys , generateSentryTraceHeader , getGlobalSingleton } from '@sentry/utils' ;
3
+ import { dropUndefinedKeys , getGlobalSingleton } from '@sentry/utils' ;
4
4
import { getAsyncContextStrategy } from './asyncContext' ;
5
5
import { getMainCarrier } from './carrier' ;
6
6
import { Scope as ScopeClass } from './scope' ;
@@ -122,7 +122,7 @@ export function getClient<C extends Client>(): C | undefined {
122
122
}
123
123
124
124
/**
125
- * Get a trace context for the currently active scopes .
125
+ * Get a trace context for the given scope .
126
126
*/
127
127
export function getTraceContextFromScope ( scope : Scope ) : TraceContext {
128
128
const propagationContext = scope . getPropagationContext ( ) ;
@@ -137,11 +137,3 @@ export function getTraceContextFromScope(scope: Scope): TraceContext {
137
137
138
138
return traceContext ;
139
139
}
140
-
141
- /**
142
- * Get a sentry-trace header value for the currently active scopes.
143
- */
144
- export function scopesToTraceHeader ( scope : Scope ) : string {
145
- const { traceId, sampled, spanId } = scope . getPropagationContext ( ) ;
146
- return generateSentryTraceHeader ( traceId , spanId , sampled ) ;
147
- }
Original file line number Diff line number Diff line change 1
1
import type { Client , Scope , Span } from '@sentry/types' ;
2
- import { dynamicSamplingContextToSentryBaggageHeader } from '@sentry/utils' ;
3
- import { getCurrentScope , scopesToTraceHeader } from '../currentScopes' ;
2
+ import { dynamicSamplingContextToSentryBaggageHeader , generateSentryTraceHeader } from '@sentry/utils' ;
3
+ import { getCurrentScope } from '../currentScopes' ;
4
4
import { spanToTraceHeader } from '../utils/spanUtils' ;
5
5
import { getDynamicSamplingContextFromScope , getDynamicSamplingContextFromSpan } from './dynamicSamplingContext' ;
6
6
@@ -25,3 +25,11 @@ export function getSentryHeaders({
25
25
baggage,
26
26
} ;
27
27
}
28
+
29
+ /**
30
+ * Get a sentry-trace header value for the given scope.
31
+ */
32
+ function scopesToTraceHeader ( scope : Scope ) : string {
33
+ const { traceId, sampled, spanId } = scope . getPropagationContext ( ) ;
34
+ return generateSentryTraceHeader ( traceId , spanId , sampled ) ;
35
+ }
You can’t perform that action at this time.
0 commit comments