MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / getActiveSpan

Function getActiveSpan

packages/core/src/utils/spanUtils.ts:434–442  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

432 * Returns the currently active span.
433 */
434export function getActiveSpan(): Span | undefined {
435 const carrier = getMainCarrier();
436 const acs = getAsyncContextStrategy(carrier);
437 if (acs.getActiveSpan) {
438 return acs.getActiveSpan();
439 }
440
441 return _getSpanForScope(getCurrentScope());
442}
443
444/**
445 * Logs a warning once if `beforeSendSpan` is used to drop spans.

Callers 15

setupSrvxTracingChannelsFunction · 0.90
captureErrorHookFunction · 0.90
SentryRootFunction · 0.90
updateSpanWithRouteFunction · 0.90
wrapRequestHandlerFunction · 0.90
getActiveRootSpanFunction · 0.90
traceCommandFunction · 0.90
startRequestSpanHookFunction · 0.90
withElysiaFunction · 0.90

Calls 4

getMainCarrierFunction · 0.90
getAsyncContextStrategyFunction · 0.90
_getSpanForScopeFunction · 0.90
getCurrentScopeFunction · 0.90

Tested by 1

traceCommandFunction · 0.72