-
Notifications
You must be signed in to change notification settings - Fork 265
Open
Labels
Description
Which middleware has the bug?
@hono/otel
What version of the middleware?
1.0.1
What version of Hono are you using?
4.9.1
What runtime/platform is your app running on? (with version if possible)
deno 2.5.4
What steps can reproduce the bug?
When using @hono/otel with httpInstrumentationMiddleware in Deno:
- Create a Deno project with Hono and @hono/otel installed.
- Import and initialize httpInstrumentationMiddleware in your API.
- Start the API with
deno run -A main.ts. - Any request triggers the error.
What is the expected behavior?
Expected behavior:
- The middleware should work in Deno without throwing the error.
- HTTP traces should be created correctly.
- Active request metrics should work or be disabled properly when configured.
What do you see instead?
On every incoming request, Deno throws:
Uncaught (in promise) Error: Only valueType: DOUBLE is supported at Meter.createUpDownCounter at createActiveRequestsTracker at httpInstrumentationMiddleware
This happens even if enableActiveRequests: false is passed, suggesting that the code path is still executed.
Additional information
Because of this mismatch, any attempt to create an UpDownCounter crashes the middleware. So even though traces work fine in Deno, the middleware cannot initialize due to unsupported metric instruments.
Confirmed workarounds (but not ideal):
- Disable middleware entirely.
- Avoid using httpInstrumentationMiddleware and implement custom tracing.
- Modify the library locally to use createObservableGauge instead of createUpDownCounter.
But we would prefer a fix in the library itself.
ASDFGamer, AlexanderHardtke, ntippman, kvth and loeka