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

Function getPreloadMethods

packages/node/src/sdk/initOtel.ts:71–83  ·  view source on GitHub ↗
(integrationNames?: string[])

Source from the content-addressed store, hash-verified

69}
70
71function getPreloadMethods(integrationNames?: string[]): ((() => void) & { id: string })[] {
72 const instruments = getOpenTelemetryInstrumentationToPreload();
73
74 if (!integrationNames) {
75 return instruments;
76 }
77
78 // We match exact matches of instrumentation, but also match prefixes, e.g. "Fastify.v5" will match "Fastify"
79 return instruments.filter(instrumentation => {
80 const id = instrumentation.id;
81 return integrationNames.some(integrationName => id === integrationName || id.startsWith(`${integrationName}.`));
82 });
83}
84
85/** Just exported for tests. */
86export function setupOtel(

Callers 1

preloadOpenTelemetryFunction · 0.85

Tested by

no test coverage detected