(integrationNames?: string[])
| 69 | } |
| 70 | |
| 71 | function 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. */ |
| 86 | export function setupOtel( |
no test coverage detected