File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/node/src/integrations/tracing Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ interface FastifyRequestRouteInfo {
3030 url ?: string ;
3131 method ?: string ;
3232 } ;
33+ // will deprecate in Fastify 5
34+ routerPath ?: string ;
3335}
3436
3537const INTEGRATION_NAME = 'Fastify' ;
@@ -78,7 +80,8 @@ export function setupFastifyErrorHandler(fastify: Fastify): void {
7880
7981 // Taken from Otel Fastify instrumentation:
8082 // https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts#L94-L96
81- const routeName = reqWithRouteInfo . routeOptions ?. url ;
83+ const routeName = reqWithRouteInfo . routeOptions ? reqWithRouteInfo . routeOptions . url : reqWithRouteInfo . routerPath ;
84+
8285 const method = reqWithRouteInfo . routeOptions ?. method || 'GET' ;
8386
8487 getIsolationScope ( ) . setTransactionName ( `${ method } ${ routeName } ` ) ;
You can’t perform that action at this time.
0 commit comments