Nextjs integration - trace outgoing HTTP requests
Closed this issue · 1 comments
I'm trying to trace outgoing HTTP requests so I've modified the appsignal.cjs
file with the following:
import { Appsignal } from '@appsignal/nodejs'
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http'
new Appsignal({
name: 'XXXX',
disableDefaultInstrumentations: [
'@opentelemetry/instrumentation-http',
],
additionalInstrumentations: [
new HttpInstrumentation({
ignoreIncomingRequestHook: () => true,
}),
],
pushApiKey: 'XXXX',
})
but this will stop the tracing altogether like throwing and shallowing the error.
How can I enable tracing only outgoing HTTP requests? (Side question: how can I enable debuging for the client?)
Hi @kostas-pblworks!
Unfortunately, due to the need to disable @opentelemetry/instrumentation-http
in order for the Next.js instrumentation to function properly, it is not possible to instrument HTTP outgoing requests from a Next.js instrumentation.
If using fetch
, those requests should be instrumented, as they are sent through a different instrumentation (either via @opentelemetry/instrumentation-undici
or through the Next.js instrumentation itself)