-
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
enhancementNew feature or requestNew feature or request
Description
💬 Question here
Hi,
I have a health endpoint that is often called and I want to disable all tracing for the endpoint and any sub-spans that may occor. I've tried using the ignorePaths and route config (config { otel: false }), and they do disable the endpoint in question, but any sub-spans are still registered, e.g. @opentelemetry/instrumentation-http and DB calls are still traced and are reported as root-spans. This creates more spam than just enabling the endpoint. I can't imagine this is the inteded way it should work, what am I doing wrong?
I tried using a parent based sampler but that has no affect.
export const fastifyOtelInstrumentation = new FastifyOtelInstrumentation({
registerOnInitialization: true,
ignorePaths: (opts) => {
return opts.url.startsWith('/healthz');
},
});
sdk = new NodeSDK({
sampler: new ParentBasedSampler({
root: new AlwaysOnSampler(),
}),
instrumentations: [
getNodeAutoInstrumentations({
'@opentelemetry/instrumentation-fastify': {
enabled: false,
},
}),
],
})
sdk.start()Your Environment
- node version: 22.16
- fastify version: 5.3.3
- fastify/otel version: 0.9.1
- os: Linux
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request