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

Function cleanupOtel

packages/node-core/test/helpers/mockSdkInit.ts:102–117  ·  view source on GitHub ↗
(_provider?: BasicTracerProvider)

Source from the content-addressed store, hash-verified

100}
101
102export function cleanupOtel(_provider?: BasicTracerProvider): void {
103 const provider = getProvider(_provider);
104
105 if (provider) {
106 void provider.forceFlush();
107 void provider.shutdown();
108 }
109
110 // Disable all globally registered APIs
111 trace.disable();
112 context.disable();
113 propagation.disable();
114
115 // Reset globals to ensure clean state
116 resetGlobals();
117}
118
119export function getSpanProcessor(): SentrySpanProcessor | undefined {
120 const client = getClient<NodeClient>();

Callers 7

scope.test.tsFile · 0.90
init.test.tsFile · 0.90
api.test.tsFile · 0.90
client.test.tsFile · 0.90

Calls 5

forceFlushMethod · 0.80
getProviderFunction · 0.70
resetGlobalsFunction · 0.70
shutdownMethod · 0.65
disableMethod · 0.65

Tested by

no test coverage detected