From 2bcb3ead24ab09081aa1559bb20372b6e00458b3 Mon Sep 17 00:00:00 2001 From: Milo Hansen Date: Tue, 8 Apr 2025 11:56:27 -0700 Subject: [PATCH] use routePath Replace indexing into the matchedRoutes with a direct reference to routePath --- packages/otel/src/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/otel/src/index.ts b/packages/otel/src/index.ts index 55bfe7a8..03252913 100644 --- a/packages/otel/src/index.ts +++ b/packages/otel/src/index.ts @@ -30,9 +30,9 @@ export const otel = (async (c, next) => { - const route = c.req.matchedRoutes[c.req.matchedRoutes.length - 1] + const routePath = c.req.routePath await tracer.startActiveSpan( - `${c.req.method} ${route.path}`, + `${c.req.method} ${routePath}`, { kind: SpanKind.SERVER, attributes: { [ATTR_HTTP_REQUEST_METHOD]: c.req.method, [ATTR_URL_FULL]: c.req.url, - [ATTR_HTTP_ROUTE]: route.path, + [ATTR_HTTP_ROUTE]: routePath, }, }, async (span) => {