Conversation
Contributor
size-limit report 📦
|
mydea
force-pushed
the
feat/hono-server-utils-integration
branch
from
September 14, 2026 14:40
7b5f046 to
1e9f2bd
Compare
mydea
force-pushed
the
feat/hono-server-utils-integration
branch
from
September 15, 2026 07:11
1e9f2bd to
45aed9a
Compare
mydea
force-pushed
the
feat/hono-server-utils-integration
branch
from
September 15, 2026 07:54
2b018b4 to
5af594d
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5af594d. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Moves the Hono instrumentation into
@sentry/server-utilsand drives it through orchestrion, so Hono is auto-instrumented out of the box by@sentry/node,@sentry/bun,@sentry/deno, and@sentry/cloudflare— no@sentry/honoimport and no manualsentry()middleware required.@sentry/honokeeps working exactly as before: it now re-uses the shared code from@sentry/server-utilsinstead of owning its own copy.How it works
@sentry/hono/src/sharedto@sentry/server-utils/src/integrations/hono.honoIntegration(default in the server SDKs'getErrorIntegrations()) hooks theHonoconstructor via an orchestrion diagnostics channel (orchestrion:hono:honoConstructor) and, on every new app, registers the Sentry request/response middleware first and applies the span patches.@sentry/server-utilstakes no dependency onhono— not at runtime (theHonoprototype is derived from the live app instance; matched routes are read from the request's own getters instead ofhono/route) and not at build/type time (the needed types are vendored inhonoTypes.ts).Per-runtime enablement
honoIntegrationis added by default everywhere. We had to add a little hack to ensure it is called early enough in cloudflare, we can remove this once Cloudflare capture crashes / data before we export the default fetch handler #24375 is fixed.Duplicate handling
Request handling is deduplicated per request via the isolation scope, so all of these run the Sentry logic exactly once:
sentry()middleware alongside the auto-instrumentation,app.request()dispatches (a new Hono context, same isolation scope).A user-provided
shouldHandleErrorstill wins even when its middleware is deduplicated behind the auto-instrumentation.Tests
@sentry/server-utils):isMiddleware,defaultShouldHandleError, and the dedup logic increateHonoMiddleware.suites/hono): auto-instrumentation with plain@sentry/node(ESM + CJS) — transaction naming, error capture/mechanism, plus regression cases for mounted sub-apps (no stray<anonymous>middleware span) and internal.request()(no span rename / request-data pollution).http.serverspan (method/route/url) for Mastra's Hono-served agent endpoint.hono-4app exercising node/bun/deno/cloudflare via the runtime SDKs directly; the previous@sentry/hono-based app is preserved ashono-4-legacy.skipsupport (getTestMatrix.mjs+run.ts).Known limitations / follow-ups
Module.registerHookspath,@apm-js-collab/tracing-hooksderives the module type only fromresult.format, which Deno doesn't report as'module'for Hono's ESM build — so a CJSrequire()is injected into an ES module (ReferenceError: require is not defined). Filed as Sync hooks path injects CommonJS require() into ESM modules on Deno → ReferenceError: require is not defined apm-js-collab/tracing-hooks#53. Thehono-4deno variant is markedskipuntil it lands. (Node works because it uses the asyncModule.registerpath, which reports the format correctly.)@sentry/honoremains as-is (thin re-export layer); no deprecation for now.