Conversation
Relocate the runtime-agnostic Hono instrumentation out of `@sentry/hono` into `packages/server-utils/src/integrations/hono/`, with `@sentry/hono` re-exporting it. Server-utils must not depend on `hono`, so the relocated code no longer imports it (the `Hono` class is passed in by the SDK and a vendored `honoTypes` provides the shapes). The `sentry()` middleware now builds its request handler via the shared `createHonoRequestMiddleware`. 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. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mydea
added this pull request to stack #24498
September 18, 2026 10:39
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 fa52eea. Configure here.
| export function wrapMiddlewareWithSpan(handler: MiddlewareHandler): MiddlewareHandler { | ||
| // Never turn Sentry's own request/response middleware into a middleware span — e.g. when an | ||
| // auto-instrumented sub-app carrying it is mounted into a parent and its handlers get wrapped. | ||
| if ((handler as unknown as Record<PropertyKey, unknown>)[SENTRY_HONO_MIDDLEWARE]) { |
There was a problem hiding this comment.
Unguarded double cast in middleware wrap
Low Severity
The new as unknown as Record<PropertyKey, unknown> double-cast has no comment explaining why a safer type is impossible. SDK source requires that justification on any, as any, double-casts, and non-null assertions.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit fa52eea. Configure here.
Contributor
size-limit report 📦
|
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.


First of two stacked PRs splitting the Hono instrumentation rework (originally #24371).
Relocates the runtime-agnostic Hono instrumentation out of
@sentry/honointo@sentry/server-utils(src/integrations/hono/), with@sentry/honore-exporting it. Since@sentry/server-utilsmust not depend onhono, the relocated code no longer imports it: theHonoclass is passed in by the SDK and a vendoredhonoTypesmodule provides the shapes. Thesentry()middleware now builds its request handler via the sharedcreateHonoRequestMiddleware. Pure relocation — no behavior change.Also renames the
hono-4e2e test app tohono-4-legacyand 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