( client: Client, scope: Scope, )
| 337 | * We have a custom implementation here because we need an OTEL-specific way to get the span from a scope. |
| 338 | */ |
| 339 | export function getTraceContextForScope( |
| 340 | client: Client, |
| 341 | scope: Scope, |
| 342 | ): [dynamicSamplingContext: Partial<DynamicSamplingContext>, traceContext: TraceContext] { |
| 343 | const ctx = getContextFromScope(scope); |
| 344 | const span = ctx && trace.getSpan(ctx); |
| 345 | |
| 346 | const traceContext = span ? spanToTraceContext(span) : getTraceContextFromScope(scope); |
| 347 | |
| 348 | const dynamicSamplingContext = span |
| 349 | ? getDynamicSamplingContextFromSpan(span) |
| 350 | : getDynamicSamplingContextFromScope(client, scope); |
| 351 | return [dynamicSamplingContext, traceContext]; |
| 352 | } |
| 353 | |
| 354 | function getActiveSpanWrapper<T>(parentSpan: Span | SentrySpan | undefined | null): (callback: () => T) => T { |
| 355 | return parentSpan !== undefined |
no test coverage detected