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

Function validateOpenTelemetrySetup

packages/vercel-edge/src/sdk.ts:121–147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

119}
120
121function validateOpenTelemetrySetup(): void {
122 if (!DEBUG_BUILD) {
123 return;
124 }
125
126 const setup = openTelemetrySetupCheck();
127
128 const required: ReturnType<typeof openTelemetrySetupCheck> = ['SentryContextManager', 'SentryPropagator'];
129
130 if (hasSpansEnabled()) {
131 required.push('SentrySpanProcessor');
132 }
133
134 for (const k of required) {
135 if (!setup.includes(k)) {
136 debug.error(
137 `You have to set up the ${k}. Without this, the OpenTelemetry & Sentry integration will not work properly.`,
138 );
139 }
140 }
141
142 if (!setup.includes('SentrySampler')) {
143 debug.warn(
144 'You have to set up the SentrySampler. Without this, the OpenTelemetry & Sentry integration may still work, but sample rates set for the Sentry SDK will not be respected. If you use a custom sampler, make sure to use `wrapSamplingDecision`.',
145 );
146 }
147}
148
149// exported for tests
150// eslint-disable-next-line jsdoc/require-jsdoc

Callers 1

initFunction · 0.70

Calls 5

openTelemetrySetupCheckFunction · 0.90
hasSpansEnabledFunction · 0.90
pushMethod · 0.80
errorMethod · 0.65
warnMethod · 0.65

Tested by

no test coverage detected