Skip to content

feat(nestjs)!: Use function span op for setup & lifecycle handlers - #22897

Merged
msonnb merged 1 commit into
ms/js-3105-handler-function-opfrom
ms/js-3105-lifecycle-function-op
Aug 6, 2026
Merged

feat(nestjs)!: Use function span op for setup & lifecycle handlers#22897
msonnb merged 1 commit into
ms/js-3105-handler-function-opfrom
ms/js-3105-lifecycle-function-op

Conversation

@msonnb

@msonnb msonnb commented Jul 31, 2026

Copy link
Copy Markdown
Member

Migrates the NestJS setup/lifecycle span ops to the cross-framework function op.

Old op New op
app_creation.nestjs function
request_context.nestjs function
event.nestjs function

Part of #22446

@linear-code

linear-code Bot commented Jul 31, 2026

Copy link
Copy Markdown

JS-3105

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 30.12 kB - -
@sentry/browser - with treeshaking flags 28.32 kB - -
@sentry/browser (incl. Tracing) 47.53 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.54 kB - -
@sentry/browser (incl. Tracing, Profiling) 52.29 kB - -
@sentry/browser (incl. Tracing, Replay) 86.91 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.33 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 91.6 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 104.25 kB - -
@sentry/browser (incl. Feedback) 47.45 kB - -
@sentry/browser (incl. sendFeedback) 34.96 kB - -
@sentry/browser (incl. FeedbackAsync) 40.1 kB - -
@sentry/browser (incl. Metrics) 31.2 kB - -
@sentry/browser (incl. Logs) 31.41 kB - -
@sentry/browser (incl. Metrics & Logs) 32.11 kB - -
@sentry/react 31.93 kB - -
@sentry/react (incl. Tracing) 49.79 kB - -
@sentry/vue 35.2 kB - -
@sentry/vue (incl. Tracing) 49.51 kB - -
@sentry/svelte 30.14 kB - -
CDN Bundle 32.13 kB - -
CDN Bundle (incl. Tracing) 47.81 kB - -
CDN Bundle (incl. Logs, Metrics) 33.67 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.19 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.02 kB - -
CDN Bundle (incl. Tracing, Replay) 85.45 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.77 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.27 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.59 kB - -
CDN Bundle - uncompressed 95.27 kB - -
CDN Bundle (incl. Tracing) - uncompressed 142.78 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.9 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.75 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.6 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 262.03 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 266 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.74 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.69 kB - -
@sentry/nextjs (client) 52.36 kB - -
@sentry/sveltekit (client) 47.99 kB - -
@sentry/core/server 65.54 kB +0.02% +7 B 🔺
@sentry/core/browser 51.82 kB - -
@sentry/node 120.46 kB +0.02% +20 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 84.09 kB +0.01% +1 B 🔺
@sentry/aws-serverless 92.59 kB +0.01% +1 B 🔺
@sentry/cloudflare (withSentry) - minified 217.81 kB - -
@sentry/cloudflare (withSentry) 537.06 kB - -

View base workflow run

@msonnb
msonnb force-pushed the ms/js-3105-lifecycle-function-op branch from cfddf2c to 5390356 Compare July 31, 2026 08:12
@msonnb msonnb changed the title feat(node)!: Use function span op for setup & lifecycle handlers feat(nestjs)!: Use function span op for setup & lifecycle handlers Jul 31, 2026
@msonnb
msonnb marked this pull request as ready for review July 31, 2026 08:22
@msonnb
msonnb requested a review from a team as a code owner July 31, 2026 08:22
@msonnb
msonnb requested review from nicohrubec and s1gr1d and removed request for a team July 31, 2026 08:22

@nicohrubec nicohrubec 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.

nice

@msonnb
msonnb force-pushed the ms/js-3105-lifecycle-function-op branch from 5390356 to 7bdc904 Compare August 4, 2026 08:53
@msonnb
msonnb requested review from a team as code owners August 5, 2026 15:35
@msonnb
msonnb requested review from JPeer264 and mydea and removed request for a team August 5, 2026 15:35
@msonnb
msonnb force-pushed the ms/js-3105-lifecycle-function-op branch from 7bdc904 to f9519b4 Compare August 5, 2026 15:51
Migrate the NestJS setup/lifecycle span ops to the cross-framework
`function` op:

- `app_creation.nestjs`    -> `function`
- `request_context.nestjs` -> `function`
- `event.nestjs`           -> `function`

Op is set via the `sentry.op` attribute only; the `nestjs.type` attribute
(`app_creation` / `request_context` / `handler`) is unchanged, so span-shape
filters keep working. Lookups that previously keyed on the distinct
`request_context` op are re-keyed on `nestjs.type`, since it now shares the
`function` op and `auto.http.nestjs` origin with the request handler span.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@msonnb
msonnb force-pushed the ms/js-3105-lifecycle-function-op branch from f9519b4 to fed2041 Compare August 6, 2026 09:57

@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 1 potential issue.

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 fed2041. Configure here.

@@ -1,5 +1,5 @@
import { SENTRY_OP } from '@sentry/conventions/attributes';
import { WEB_SERVER_MIDDLEWARE_SPAN_OP } from '@sentry/conventions/op';
import { WEB_SERVER_FUNCTION_SPAN_OP, WEB_SERVER_MIDDLEWARE_SPAN_OP } from '@sentry/conventions/op';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Wrong function span op constant

High Severity

This migration imports WEB_SERVER_FUNCTION_SPAN_OP, but the cross-framework function op constant used elsewhere in this repo is GENERAL_FUNCTION_SPAN_OP (see Angular and Cloudflare). function is a general-category op, not a web-server one, so this constant name does not match the intended shared convention and is not used anywhere else in the monorepo.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fed2041. Configure here.

@msonnb
msonnb merged commit 32b7761 into develop Aug 6, 2026
56 checks passed
@msonnb
msonnb deleted the ms/js-3105-lifecycle-function-op branch August 6, 2026 11:34
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.

3 participants