MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / setCapturedScopesOnSpan

Function setCapturedScopesOnSpan

packages/core/src/tracing/utils.ts:25–32  ·  view source on GitHub ↗
(span: Span | undefined, scope: Scope, isolationScope: Scope)

Source from the content-addressed store, hash-verified

23
24/** Store the scope & isolation scope for a span, which can the be used when it is finished. */
25export function setCapturedScopesOnSpan(span: Span | undefined, scope: Scope, isolationScope: Scope): void {
26 if (span) {
27 addNonEnumerableProperty(span, ISOLATION_SCOPE_ON_START_SPAN_FIELD, makeWeakRef(isolationScope));
28 // We don't wrap the scope with a WeakRef here because webkit aggressively garbage collects
29 // and scopes are not held in memory for long periods of time.
30 addNonEnumerableProperty(span, SCOPE_ON_START_SPAN_FIELD, scope);
31 }
32}
33
34/**
35 * Grabs the scope and isolation scope off a span that were active when the span was started.

Callers 12

utils.test.tsFile · 0.90
startIdleSpanFunction · 0.90
createChildOrRootSpanFunction · 0.90
_startRootSpanFunction · 0.90
_startChildSpanFunction · 0.90
handleOnSpanStartFunction · 0.90
wrapMiddlewareWithSentryFunction · 0.90
wrapApiHandlerWithSentryFunction · 0.90
initFunction · 0.90
onStartMethod · 0.90

Calls 2

addNonEnumerablePropertyFunction · 0.90
makeWeakRefFunction · 0.90

Tested by

no test coverage detected