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

Function getScopes

packages/opentelemetry/src/asyncContextStrategy.ts:23–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21 getTracingChannelBinding?: () => TracingChannelBinding | undefined;
22}): void {
23 function getScopes(): CurrentScopes {
24 const ctx = api.context.active();
25 const scopes = getScopesFromContext(ctx);
26
27 if (scopes) {
28 return scopes;
29 }
30
31 // fallback behavior:
32 // if, for whatever reason, we can't find scopes on the context here, we have to fix this somehow
33 return {
34 scope: getDefaultCurrentScope(),
35 isolationScope: getDefaultIsolationScope(),
36 };
37 }
38
39 function withScope<T>(callback: (scope: Scope) => T): T {
40 const ctx = api.context.active();

Callers 2

getCurrentScopeFunction · 0.70
getIsolationScopeFunction · 0.70

Calls 4

getScopesFromContextFunction · 0.90
getDefaultCurrentScopeFunction · 0.90
getDefaultIsolationScopeFunction · 0.90
activeMethod · 0.45

Tested by

no test coverage detected