Skip to content

feat(frameworks)!: Use function op for framework functions - #23047

Merged
msonnb merged 7 commits into
developfrom
ms/framework-function-op
Aug 7, 2026
Merged

feat(frameworks)!: Use function op for framework functions#23047
msonnb merged 7 commits into
developfrom
ms/framework-function-op

Conversation

@msonnb

@msonnb msonnb commented Aug 5, 2026

Copy link
Copy Markdown
Member

Framework function spans previously each carried a granular, per-framework op (function.sveltekit.load, function.react_router.loader, function.nextjs, function.remix.document_request, function.server_action, function.tanstackstart, …). This unifies them onto the standardized function op from conventions

The detail that lived in the op now lives in sentry.origin and code.function.name (the wrapped function's real name), added where the origin alone no longer distinguishes spans.

Affected: sveltekit, react-router, nextjs, remix, solidstart, tanstackstart-react.

part of #22446

@msonnb

msonnb commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

c'mon, do something

Comment thread packages/remix/src/server/instrumentServer.ts
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 30.15 kB - -
@sentry/browser - with treeshaking flags 28.35 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.66 kB - -
@sentry/browser (incl. Tracing) 47.56 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.57 kB - -
@sentry/browser (incl. Tracing, Profiling) 52.31 kB - -
@sentry/browser (incl. Tracing, Replay) 86.93 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.36 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 91.66 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 104.29 kB - -
@sentry/browser (incl. Feedback) 47.48 kB - -
@sentry/browser (incl. sendFeedback) 34.98 kB - -
@sentry/browser (incl. FeedbackAsync) 40.13 kB - -
@sentry/browser (incl. Metrics) 31.22 kB - -
@sentry/browser (incl. Logs) 31.44 kB - -
@sentry/browser (incl. Metrics & Logs) 32.13 kB - -
@sentry/react 31.95 kB - -
@sentry/react (incl. Tracing) 49.81 kB - -
@sentry/vue 35.25 kB - -
@sentry/vue (incl. Tracing) 49.57 kB - -
@sentry/svelte 30.17 kB - -
CDN Bundle 32.16 kB - -
CDN Bundle (incl. Tracing) 47.83 kB - -
CDN Bundle (incl. Logs, Metrics) 33.7 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.21 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.03 kB - -
CDN Bundle (incl. Tracing, Replay) 85.47 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.79 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.29 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.61 kB - -
CDN Bundle - uncompressed 95.33 kB - -
CDN Bundle (incl. Tracing) - uncompressed 142.84 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.96 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.82 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.66 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 262.09 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 266.06 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.8 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.75 kB - -
@sentry/nextjs (client) 52.39 kB - -
@sentry/sveltekit (client) 48.01 kB - -
@sentry/core/server 65.58 kB - -
@sentry/core/browser 51.82 kB - -
@sentry/node 119.28 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 83.3 kB -0.01% -1 B 🔽
@sentry/aws-serverless 92.61 kB -0.01% -1 B 🔽
@sentry/cloudflare (withSentry) - minified 214.16 kB - -
@sentry/cloudflare (withSentry) 528.83 kB - -

View base workflow run

@msonnb
msonnb force-pushed the ms/framework-function-op branch from 0306fef to 502d908 Compare August 5, 2026 09:22
@msonnb
msonnb marked this pull request as ready for review August 5, 2026 09:47
@msonnb
msonnb requested a review from a team as a code owner August 5, 2026 09:47
@msonnb
msonnb requested review from nicohrubec and s1gr1d and removed request for a team August 5, 2026 09:47
);

expect(actionSpan).toBeDefined();
expect(actionSpan?.op).toBe('action.remix');

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: do we (need to) preserve this information somehow that this is action or loader? do we set code.function.name here? if we set it we should probably also assert on it

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.

yes we set it and implicitly asserted it by using it in the .find() predicate above, but added an explicit assertion and changed to code.function.name since code.function will be deprecated 👍

const middlewareSpan = transaction?.spans?.find(
(span: { data?: { 'sentry.op'?: string } }) => span.data?.['sentry.op'] === 'function.react_router.middleware',
);
const middlewareSpan = transaction?.spans?.find(span => span.data?.['code.function.name'] === 'middleware');

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: are these actually middlewares or just functions that are called middleware? if the former shouldn't the op be middleware?

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.

good catch! updated to middleware

trace_id: expect.any(String),
data: {
'sentry.origin': 'auto.http.react_router',
'sentry.op': 'function.react_router.action',

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: same here is action preserved as code.function.name?

@msonnb msonnb Aug 6, 2026

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 was already dead since we removed the asserted spans in #22529. removed the tests (they didn't fail because they were skipped already)

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

🥇

Comment thread packages/react-router/src/client/createClientInstrumentation.ts
Comment thread packages/sveltekit/src/server-common/load.ts
Comment thread packages/sveltekit/src/server-common/serverRoute.ts Outdated
@msonnb
msonnb force-pushed the ms/framework-function-op branch from ca24d4f to 4e0c372 Compare August 7, 2026 07: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 4e0c372. Configure here.

@msonnb
msonnb merged commit 6a35f85 into develop Aug 7, 2026
114 checks passed
@msonnb
msonnb deleted the ms/framework-function-op branch August 7, 2026 08:32
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.

2 participants