When a framework (e.g. nitro) uses a custom ~findRoute function instead of registering routes via h3["~routes"] or h3.on(), the tracingPlugin never wraps those route handlers with wrapEventHandler.
The plugin currently wraps routes in three places:
- Iterating h3["~routes"] at registration time (line 30)
- Patching h3.on() for future routes (line 37)
- Patching h3.use() for middleware (line 49)
But nitro sets h3["~findRoute"] directly (bypassing ~routes entirely) to resolve file-based routes at request time. Since the plugin never intercepts ~findRoute, those route handlers are never wrapped, so no h3.request tracing channel event with type: "route" is ever emitted.
Middleware tracing works fine because nitro pushes global middleware to h3["~middleware"], which the plugin does wrap.
Expected behavior:
A request to a nitro file-based route should emit both a middleware span (type: "middleware") and a route handler span (type: "route").
Actual behavior:
Only middleware spans are emitted. The route handler executes untraced by h3.
When a framework (e.g. nitro) uses a custom
~findRoutefunction instead of registering routes viah3["~routes"]orh3.on(), thetracingPluginnever wraps those route handlers withwrapEventHandler.The plugin currently wraps routes in three places:
But nitro sets
h3["~findRoute"]directly (bypassing ~routes entirely) to resolve file-based routes at request time. Since the plugin never intercepts~findRoute, those route handlers are never wrapped, so no h3.request tracing channel event with type: "route" is ever emitted.Middleware tracing works fine because nitro pushes global middleware to
h3["~middleware"], which the plugin does wrap.Expected behavior:
A request to a nitro file-based route should emit both a middleware span (type: "middleware") and a route handler span (type: "route").
Actual behavior:
Only middleware spans are emitted. The route handler executes untraced by h3.