Skip to content

Commit f556dc2

Browse files
authored
fix: resolve h3 route when setting "url.path" (#12)
1 parent 453a357 commit f556dc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default <NitroAppPlugin>((nitro) => {
1616
const parentCtx = trace.getSpan(currentContext) ? currentContext : api.propagation.extract(currentContext, getHeaders(event));
1717
const span = tracer.startSpan(await getSpanName(event), {
1818
attributes: {
19-
[ATTR_URL_PATH]: event.context.matchedRoute?.path || event.path,
19+
[ATTR_URL_PATH]: (await nitro.h3App.resolve(event.path))?.route || event.path,
2020
[ATTR_URL_FULL]: event.path,
2121
[ATTR_HTTP_REQUEST_METHOD]: event.method,
2222
[ATTR_URL_SCHEME]: getRequestProtocol(event),

0 commit comments

Comments
 (0)