Skip to content

Commit

Permalink
fix: resolve h3 route when setting "url.path" (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
huang-julien authored Jan 18, 2025
1 parent 453a357 commit f556dc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default <NitroAppPlugin>((nitro) => {
const parentCtx = trace.getSpan(currentContext) ? currentContext : api.propagation.extract(currentContext, getHeaders(event));
const span = tracer.startSpan(await getSpanName(event), {
attributes: {
[ATTR_URL_PATH]: event.context.matchedRoute?.path || event.path,
[ATTR_URL_PATH]: (await nitro.h3App.resolve(event.path))?.route || event.path,
[ATTR_URL_FULL]: event.path,
[ATTR_HTTP_REQUEST_METHOD]: event.method,
[ATTR_URL_SCHEME]: getRequestProtocol(event),
Expand Down

0 comments on commit f556dc2

Please sign in to comment.