( client: Client, scope: Scope | undefined, )
| 11 | |
| 12 | /** Extract trace information from scope */ |
| 13 | export function _getTraceInfoFromScope( |
| 14 | client: Client, |
| 15 | scope: Scope | undefined, |
| 16 | ): [dynamicSamplingContext: Partial<DynamicSamplingContext> | undefined, traceContext: TraceContext | undefined] { |
| 17 | if (!scope) { |
| 18 | return [undefined, undefined]; |
| 19 | } |
| 20 | |
| 21 | return withScope(scope, () => { |
| 22 | const span = getActiveSpan(); |
| 23 | const traceContext = span ? spanToTraceContext(span) : getTraceContextFromScope(scope); |
| 24 | const dynamicSamplingContext = span |
| 25 | ? getDynamicSamplingContextFromSpan(span) |
| 26 | : getDynamicSamplingContextFromScope(client, scope); |
| 27 | return [dynamicSamplingContext, traceContext]; |
| 28 | }); |
| 29 | } |
no test coverage detected