Skip to content

feat!: Use function span op for terminal request handlers - #22871

Draft
msonnb wants to merge 1 commit into
ms/js-3105-middleware-span-opfrom
ms/js-3105-handler-function-op
Draft

feat!: Use function span op for terminal request handlers#22871
msonnb wants to merge 1 commit into
ms/js-3105-middleware-span-opfrom
ms/js-3105-handler-function-op

Conversation

@msonnb

@msonnb msonnb commented Jul 30, 2026

Copy link
Copy Markdown
Member

Migrates the terminal request-handler span ops across the server integrations to the cross-framework function op, and traces Hono’s internal app.request() dispatch as an http.server span:

Integration Before After
express request_handler.express function
fastify request_handler.fastify function
elysia request_handler.elysia function
nestjs handler.nestjs function
hono hono.request http.server

Decisions

  • The terminal handler is the leaf of the framework request pipeline — it runs the user’s route callback — so it maps to the generic function op rather than a framework-specific request_handler.* op, which was never a registered convention. Middleware phases keep the middleware op from the parent PR.
  • Hono’s app.request() is an internal HTTP dispatch (one sub-app calling another in-process), so it is semantically an inbound server request and is now traced as http.server. It keeps its distinct auto.http.hono.internal_request origin, which stays the reliable discriminator for these spans — the hono-4 multi-fetch e2e assertions were switched from filtering on the (now-ambiguous) op to filtering on that origin.

Part of #22446

Migrate the terminal request-handler span ops across the server
integrations to the cross-framework `function` op, and trace Hono's
internal `app.request()` dispatch as an `http.server` span:

- express: `request_handler.express` -> `function`
- fastify: `request_handler.fastify` -> `function`
- elysia:  `request_handler.elysia`  -> `function`
- nestjs:  `handler.nestjs`          -> `function`
- hono:    `hono.request`            -> `http.server`

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jul 30, 2026

Copy link
Copy Markdown

JS-3105

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.82 kB added added
@sentry/browser - with treeshaking flags 28.02 kB added added
@sentry/browser (incl. Tracing) 47.08 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 47.09 kB added added
@sentry/browser (incl. Tracing, Profiling) 51.82 kB added added
@sentry/browser (incl. Tracing, Replay) 86.39 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.83 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 91.11 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 103.76 kB added added
@sentry/browser (incl. Feedback) 47.13 kB added added
@sentry/browser (incl. sendFeedback) 34.66 kB added added
@sentry/browser (incl. FeedbackAsync) 39.76 kB added added
@sentry/browser (incl. Metrics) 30.89 kB added added
@sentry/browser (incl. Logs) 31.12 kB added added
@sentry/browser (incl. Metrics & Logs) 31.8 kB added added
@sentry/react 31.6 kB added added
@sentry/react (incl. Tracing) 49.33 kB added added
@sentry/vue 34.74 kB added added
@sentry/vue (incl. Tracing) 49.05 kB added added
@sentry/svelte 29.85 kB added added
CDN Bundle 31.87 kB added added
CDN Bundle (incl. Tracing) 47.45 kB added added
CDN Bundle (incl. Logs, Metrics) 33.42 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 48.82 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 72.78 kB added added
CDN Bundle (incl. Tracing, Replay) 85.08 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.38 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 90.85 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.16 kB added added
CDN Bundle - uncompressed 95.04 kB added added
CDN Bundle (incl. Tracing) - uncompressed 142.27 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.75 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.25 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.51 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 261.52 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 265.49 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.23 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.18 kB added added
@sentry/nextjs (client) 51.92 kB added added
@sentry/sveltekit (client) 47.51 kB added added
@sentry/core/server 79.61 kB added added
@sentry/core/browser 51.58 kB added added
@sentry/node 121.33 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B added added
@sentry/node - without tracing 84.77 kB added added
@sentry/aws-serverless 93.02 kB added added
@sentry/cloudflare (withSentry) - minified 197.59 kB added added
@sentry/cloudflare (withSentry) 485.77 kB added added

@msonnb msonnb changed the title feat(node)!: Use function span op for terminal request handlers feat!: Use function span op for terminal request handlers Jul 30, 2026
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.

1 participant