Skip to content

feat(hono): add orchestrion-based auto-instrumentation - #24497

Merged
mydea merged 17 commits into
feat/hono-move-to-server-utilsfrom
feat/hono-orchestrion-instrumentation
Sep 30, 2026
Merged

mydea merged 17 commits into
feat/hono-move-to-server-utilsfrom
feat/hono-orchestrion-instrumentation

Conversation

@mydea

@mydea mydea commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Second of two stacked PRs splitting the Hono instrumentation rework (originally #24371). Stacked on #24496 — review/merge that first; the diff here is against the base PR's branch.

Adds honoIntegration, the auto-instrumentation that hooks Hono through the orchestrion module transform (node:diagnostics_channel) so requests are route-enriched without a manual sentry() middleware, plus its manual counterpart honoMiddleware. Registers it in getErrorIntegrations() and re-exports both from the server runtimes (node, cloudflare, bun, deno, and the serverless / meta-framework packages).

Also adds the orchestrion transform config for hono, node-integration-tests for the auto-instrumentation, and a new orchestrion-based hono-4 e2e app (the middleware-based app now lives as hono-4-legacy, added in the base PR). node-mastra now asserts route-enriched Hono spans in prod, where Hono is external and orchestrion-instrumented.

Root cause / notable fix: pulling the Hono module into the Cloudflare barrel reshuffled the worker bundle's module-init order and surfaced a latent TDZ crash for provided-module integrations (Flue): Cannot access 'flueIntegration' before initialization at worker startup. The orchestrion snippet injected into each instrumented module passed the integration factory by reference, reading the binding the instant that module evaluated — and since @sentry/*/vite imports a provided-module integration back into its own instrumented package, that closes an import cycle. The snippet now wraps the factory in an arrow (() => flueIntegration()) so the binding is only read when the stored thunk runs at init(), breaking the cycle.

Also folds in a few follow-ups: honoMiddleware is now exported from the remaining runtimes that only had honoIntegration (elysia, remix, solidstart, sveltekit), the shared INTERNAL_REQUEST_ORIGIN constant moved into hono/constants.ts, and the previously-skipped .basePath() middleware e2e test is unskipped — the per-request orchestrion hook discovers middleware from the matched-handler list at dispatch, so it now works on the clone .basePath() returns.

🤖 Generated with Claude Code

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.24 kB - -
@sentry/browser - with treeshaking flags 27.5 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.4 kB - -
@sentry/browser (incl. Tracing) 51.15 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.18 kB - -
@sentry/browser (incl. Tracing, Profiling) 54.18 kB - -
@sentry/browser (incl. Tracing, Replay) 90.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.86 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 95.46 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 108.41 kB - -
@sentry/browser (incl. Feedback) 46.76 kB - -
@sentry/browser (incl. sendFeedback) 34.3 kB - -
@sentry/browser (incl. FeedbackAsync) 39.41 kB - -
@sentry/browser (incl. Metrics) 30.25 kB - -
@sentry/browser (incl. Logs) 30.53 kB - -
@sentry/browser (incl. Metrics & Logs) 31.2 kB - -
@sentry/react 31.08 kB - -
@sentry/react (incl. Tracing) 53.54 kB - -
@sentry/vue 36.74 kB -0.11% -40 B 🔽
@sentry/vue (incl. Tracing) 53.7 kB -0.07% -36 B 🔽
@sentry/svelte 29.26 kB - -
CDN Bundle 31.05 kB - -
CDN Bundle (incl. Tracing) 51.8 kB - -
CDN Bundle (incl. Logs, Metrics) 33.31 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.77 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.02 kB - -
CDN Bundle (incl. Tracing, Replay) 89.39 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.36 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 95.55 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 97.53 kB - -
CDN Bundle - uncompressed 91.7 kB - -
CDN Bundle (incl. Tracing) - uncompressed 154.08 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 98.27 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 160.04 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.84 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 273.81 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 279.75 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.51 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 293.44 kB - -
@sentry/nextjs (client) 55.78 kB - -
@sentry/sveltekit (client) 51.6 kB - -
@sentry/core/server 39.99 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 144.03 kB +1.25% +1.78 kB 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.98 kB +0.12% +98 B 🔺
@sentry/node - without tracing 92.91 kB +1.83% +1.67 kB 🔺
@sentry/node - without channel injection 122.41 kB +1.46% +1.75 kB 🔺
@sentry/aws-serverless 101.17 kB +1.67% +1.66 kB 🔺
@sentry/cloudflare (withSentry) - minified 206.69 kB - -
@sentry/cloudflare (withSentry) 514.13 kB - -

View base workflow run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/server-utils/src/integrations/hono/createHonoMiddleware.ts
Comment thread packages/server-utils/src/integrations/hono/honoIntegration.ts
@mydea
mydea force-pushed the feat/hono-orchestrion-instrumentation branch from d3071cb to bef613e Compare September 21, 2026 08:13

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread dev-packages/e2e-tests/test-applications/hono-4/package.json
Comment thread packages/server-utils/src/integrations/hono/honoIntegration.ts
@mydea
mydea force-pushed the feat/hono-orchestrion-instrumentation branch from bef613e to 8941894 Compare September 21, 2026 09:10

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment on lines +108 to +121
/**
* Per-request Context hook: the heart of the automatic instrumentation.
*
* `#dispatch` builds `new Context(req, { matchResult })` before its single-handler fast-path check,
* passing the live `matchResult` array. We:
* 1. wrap the already-matched MIDDLEWARE handlers (arity ≥ 2) for spans — route handlers (arity < 2)
* are covered by the request span and left as-is;
* 2. prepend the Sentry request/response middleware, so it runs first in the composed chain. That
* both drives route naming / request data / error capture (from inside the chain, with the
* Context) and forces the ≥2-handler `compose` path, so there is no fast-path gap.
*
* All of this runs per request, so it works on Cloudflare (no module-scope publish) and needs no
* app-instance patching or app-construction hook.
*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is not up-to-date with the "detection" code anymore.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated comments generally!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we maybe clear the flags (HONO_REQUEST_HANDLED and HONO_SHOULD_HANDLE_ERROR) here after the response?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be necessary, because:

  • When there's a per-request isolation scope, getRequestScope stores them there. The SDK forks a fresh isolation scope per request, so the object (and its flags) is discarded when the request ends.
    • When there isn't one (isolationScope === getDefaultIsolationScope()), it deliberately falls back to the Hono Context, not the default scope — and Hono builds a new Context per dispatch. Also per-request.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true for most scenarios (so it's fine to keep it) but for cases where there's a user-forked isolation scope in for example Cloudflare scheduled handlers (also email and queue).

That's an edge case that can be handled in another PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed a change to clean this up!

@mydea
mydea marked this pull request as ready for review September 21, 2026 12:52
@mydea
mydea requested review from a team as code owners September 21, 2026 12:52
@mydea
mydea requested review from JPeer264, isaacs, nicohrubec and s1gr1d and removed request for a team September 21, 2026 12:52
Comment thread packages/server-utils/src/integrations/hono/createHonoMiddleware.ts

@isaacs isaacs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the right approach overall.

The duplicate error issue is worth fixing before landing. Apart from that, three trade-offs are made (likely correctly!) which should be called out:

  1. Every Hono request will now takes the compose path instead of Hono's single-handler fast path, even with tracing disabled, because the integration is in getErrorIntegrations(). That's because we unshift the Sentry middleware (honoIntegration.ts line 160) so a one-handler route now has two handlers, so it always takes the compose path. (Not sure this is possible to avoid, tbh.)
  2. c.req.matchedRoutes and c.req.routeIndex change shape for user code.
  3. Cloudflare loses connection-info attributes relative to the manual @sentry/hono middleware. (I'm not sure this is necessary, there may be a way to fix this, mentioned in the comments re createRequire below.)

Comment thread packages/server-utils/src/integrations/index.ts
// oxlint-disable-next-line typescript/no-deprecated
setupFastifyErrorHandler,
firebaseIntegration,
honoIntegration,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why elysia, remix, solidstart, and sveltekit only get honoIntegration, and not honoMiddleware?

If so, we should call it out. If not, we should probably make it consistent.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, good catch!

Comment thread packages/server-utils/src/integrations/hono/createHonoMiddleware.ts
* Resolves the runtime's `getConnInfo` helper once, best-effort.
*
* Cloudflare Workers can't `require()` out of a bundle at runtime, so there conn-info is left to the
* platform's `requestDataIntegration`. On Node/Bun/Deno a missing optional peer dependency degrades

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so there conn-info is left to the platform's requestDataIntegration.

I don't think that's true? Maybe that's fine, because it's intended to be best effort. But it looks like cloudflare just gets dropped (returns undefined), and no conn-info is added, because the requestDataIntegration doesn't set client.address/client.port span attributes.

The Hono SDK does this with static imports, like import { getConnInfo } from 'hono/cloudflare-workers'; in packages/hono/src/cloudflare/middleware.ts.

Suggestion: add an optional getConnInfo to HonoIntegrationOptions (CreateHonoRequestMiddlewareOptions already has the field, see packages/server-utils/src/integrations/hono/createHonoMiddleware.ts line 23). Then a Cloudflare user, or packages/cloudflare itself, can pass getConnInfo from hono/cloudflare-workers with a static import, and the createRequire fallback can shrink to Node only or go away.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clanker says:

  1. Hono's Cloudflare getConnInfo is trivial — it does nothing but read one header:
    (c) => ({ remote: { address: c.req.header('cf-connecting-ip') } })
    No socket, no port, no transport. Same for cloudflare-pages.
  2. We don't need require at all. The current avoidance is about createRequire in workerd — but since the CF helper is just a header read, we can inline it. That's fully static and workerd-safe, so it doesn't
    touch the "lazy loading is a last resort" rule.
  3. The IP is already captured on Cloudflare. The CF SDK runs requestDataIntegration() (baseSdk.ts:62), whose getClientIPAddress header list includes CF-Connecting-IP (vendor/getIpAddress.ts:12). It sets
    user.ip_address on both the event and the span. So the existing code comment ("left to the platform's requestDataIntegration") is accurate.

So if I follow correctly, everything this would set (ip address) is already set, so this is ok to just be omitted?

Comment on lines +139 to +140
honoIntegration,
honoMiddleware,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pulls in node:module, but wouldn't if we avoid using createRequire. I'm not sure how big a deal that is, since we require a pretty recent nodejs compat setting anyway, but I seem to recall that we avoided that in the past for some reason. Bundling maybe? I forget; @timfish might know.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this scenario it should be ok. Importing should be fine - on Cloudflare we bail out before we call it - so all cool. We didn't import back then because we only had nodejs_als - that's a rough guess but I can't think any other reason.

Comment thread dev-packages/node-integration-tests/suites/hono/scenario.mjs Outdated
Comment thread dev-packages/e2e-tests/test-applications/hono-4/build-bun.ts Outdated
// forwarded defaults and the two never stack.
const INTEGRATION_NAME = 'Hono' as const;

const INTERNAL_REQUEST_ORIGIN = 'auto.http.hono.internal_request';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also set in packages/server-utils/src/integrations/hono/patchAppRequest.ts on line 15. Could it be exported from there, so it's only defined in one place?

Comment thread packages/server-utils/src/integrations/hono/honoIntegration.ts

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great overall - Isaac had some nice points. Once they're addressed I'll approve. Mine are mostly small nits - non blocking

variants.forEach(variant => {
// Allow skipping an individual variant (e.g. one blocked by an upstream bug) while keeping the
// others. `sentryTest.skip` above skips the whole app; this is the per-variant equivalent.
if (variant.skip) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: That is not used (anymore), right? Not sure if this is a left over or needed for another PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, had this to skip something before, imho still valuable to have this capability so I left it in?

Comment thread dev-packages/e2e-tests/test-applications/hono-4/src/instrument.server.ts Outdated
});
});

// TODO: this test is currently skipped because we do not yet support middleware registered on new instances (e.g. here via .basePath(..).use(...)).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: This was here before already, is this something that could be easily added with the new approach? (not suggesting to add this functionality in this PR). Just hinting if the "new way" could solve this (easier) than before

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, this test passes now, so can simply be unskipped! 🎉

@@ -0,0 +1,168 @@
import { expect, test } from '@playwright/test';
import { waitForStreamedSpan, getSpanOp } from '@sentry-internal/test-utils';
import { APP_NAME, RUNTIME, type Runtime } from './constants';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note for myself: since I also tried to reuse existing tests in other runtimes for more coverage: #24598 (the way to use runtimes might need some consolidation once they're in)

Comment thread dev-packages/e2e-tests/test-applications/hono-4/vite.config.ts Outdated
'build-command': string;
'assert-command'?: string;
label?: string;
skip?: boolean;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +139 to +140
honoIntegration,
honoMiddleware,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this scenario it should be ok. Importing should be fine - on Cloudflare we bail out before we call it - so all cool. We didn't import back then because we only had nodejs_als - that's a rough guess but I can't think any other reason.

@github-actions

Copy link
Copy Markdown
Contributor

👋 @nicohrubec, @s1gr1d — Please review this PR when you get a chance!

@mydea
mydea force-pushed the feat/hono-orchestrion-instrumentation branch from d7880fd to f961a74 Compare September 29, 2026 07:41

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/server-utils/src/integrations/hono/honoIntegration.ts
@mydea
mydea force-pushed the feat/hono-orchestrion-instrumentation branch from 746de6f to 1a39cad Compare September 29, 2026 12:15

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

There are 3 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1a39cad. Configure here.

Comment thread packages/cloudflare/src/index.ts
@mydea
mydea force-pushed the feat/hono-orchestrion-instrumentation branch from 1a39cad to f2e09f7 Compare September 29, 2026 12:53
mydea and others added 15 commits September 30, 2026 08:59
Add `honoIntegration`, the auto-instrumentation that hooks Hono through the
orchestrion module transform (`node:diagnostics_channel`) so requests are
route-enriched without a manual `sentry()` middleware, plus its manual
counterpart `honoMiddleware`. Register it in `getTracingIntegrations()` and
re-export both from the server runtimes (node, cloudflare, bun, deno, and the
serverless/meta-framework packages).

Adds the orchestrion transform config for `hono`, node-integration-tests for
the auto-instrumentation, and a new orchestrion-based `hono-4` e2e app (the
middleware-based app now lives as `hono-4-legacy`). node-mastra now asserts
route-enriched Hono spans in prod, where Hono is external and instrumented.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
An internal app.request() runs in a new Hono context but the same isolation scope,
so the request-handling dedup short-circuited the inner Sentry middleware before it
could capture context.error. When an outer handler swallowed a failed internal
response (degrading to a 200), the inner route's error was never reported. The
deduplicated middleware now still captures its own context's error, without
re-naming the transaction or overwriting request data.

Also streamline the orchestrion hono config comments, add a named-function
middleware span test, and add node-integration coverage for the inner-error case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The auto-instrumentation injection loop used a raw arity check to decide which
matched handlers to wrap as middleware spans. Use the shared isMiddleware helper
instead, which unwraps onError-composed sub-app handlers before checking arity — a
case the inline check missed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Arity alone cannot tell a middleware from a route handler declared with an unused
`next` param. The matched entries carry their registration routeMeta, so apply the
same positional heuristic as wrapSubAppMiddleware: within a method+path group the
last handler is the route handler and earlier ones are middleware; `.use()` (method
'ALL') falls back to arity. Adds node-integration coverage for the arity-2 route
handler case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Restores coverage lost when the shared Hono unit tests were removed during
the move to @sentry/server-utils. The observable route-name and middleware
span-status behaviors move into the node-integration `hono` suite; the
route-hook's non-invasive prototype patching (invisible to spans/events)
is restored as a focused unit test.

- resolveRouteName: overlapping catch-all handler and middleware-only path
  fallback
- wrapMiddlewareWithSpan: 3xx/4xx middleware errors do not set an error span
  status, 5xx does
- installRouteHookOnPrototype: preserves name/length/symbols/prototype of the
  original route method

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The dedup branch of createHonoRequestMiddleware calls captureContextError, but
the mock only stubbed requestHandler/responseHandler, so the deduplication
tests threw "No captureContextError export is defined on the mock".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Trim the comments in honoIntegration to the non-obvious reasoning (Hono's
internal matchResult shape, the cached-array injection guard, the synchronous
Context-constructor timing, the compose fast-path) and drop the narration of
what the code already shows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: isaacs <i@izs.me>
Co-authored-by: Jan Peer Stöcklmair <jan.oster94@gmail.com>
…cted snippet

The build-time snippet injected into each instrumented module passed the
integration factory by reference (`orchestrionModuleInjected('@flue/runtime',
flueIntegration)`), reading the binding the instant that module evaluated. For a
provided-module integration like Flue — which `@sentry/*/vite` imports back into
its own instrumented package — this closes an import cycle and crashes the worker
at startup with "Cannot access 'flueIntegration' before initialization". Wrapping
it in an arrow (`() => flueIntegration()`) defers the read until the stored thunk
runs (at `init()`), which is what breaks the cycle; the consumer still gets an
Integration from `factory()`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mydea
mydea force-pushed the feat/hono-orchestrion-instrumentation branch from f2e09f7 to c78651e Compare September 30, 2026 07:00
The new hono node-integration suite relies on orchestrion auto-instrumentation,
which `bun run` cannot inject. Also bump the @sentry/node size limit, which
develop pushed over 144 KB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread packages/server-utils/src/integrations/hono/createHonoMiddleware.ts
The dedup markers live on the isolation scope. When that scope outlives the
request, e.g. forked once around the whole server on a runtime without
per-request isolation, every later request was treated as a duplicate and lost
its route name and request data, and could pick up a stale shouldHandleError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing!! That is an insane win!

@mydea
mydea merged commit f9487f2 into develop Sep 30, 2026
684 of 687 checks passed
@mydea
mydea deleted the feat/hono-orchestrion-instrumentation branch September 30, 2026 12:18
mydea added a commit that referenced this pull request Sep 30, 2026
…#24496)

First of two stacked PRs splitting the Hono instrumentation rework
(originally #24371).

Relocates the runtime-agnostic Hono instrumentation out of
`@sentry/hono` into `@sentry/server-utils` (`src/integrations/hono/`),
with `@sentry/hono` re-exporting it. Since `@sentry/server-utils` must
not depend on `hono`, the relocated code no longer imports it: the
`Hono` class is passed in by the SDK and a vendored `honoTypes` module
provides the shapes. The `sentry()` middleware now builds its request
handler via the shared `createHonoRequestMiddleware`. Pure relocation —
no behavior change.

Also renames the `hono-4` e2e test app to `hono-4-legacy` and moves the
corresponding unit tests alongside the relocated code.

The orchestrion-based auto-instrumentation that builds on this lives in
the stacked PR #24497.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants