Skip to content

Commit

Permalink
fix(express): get route
Browse files Browse the repository at this point in the history
  • Loading branch information
DmytryS committed Nov 20, 2024
1 parent d0fb135 commit aabcde2
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,13 @@ export class ExpressInstrumentation extends InstrumentationBase<ExpressInstrumen
] as ExpressLayerType;

const rpcMetadata = getRPCMetadata(context.active());
if (rpcMetadata?.type === RPCType.HTTP) {
if (
rpcMetadata?.type === RPCType.HTTP
&& (
!rpcMetadata.route
|| rpcMetadata?.route?.length < route?.length
)
) {
rpcMetadata.route = route || '/';
}

Expand Down

0 comments on commit aabcde2

Please sign in to comment.