Skip to content

feat(server-utils): Emit low cardinality graphql span names - #23542

Draft
andreiborza wants to merge 3 commits into
developfrom
ab/graphql-low-cardinality-span-names
Draft

feat(server-utils): Emit low cardinality graphql span names#23542
andreiborza wants to merge 3 commits into
developfrom
ab/graphql-low-cardinality-span-names

Conversation

@andreiborza

@andreiborza andreiborza commented Aug 24, 2026

Copy link
Copy Markdown
Member

What

With span streaming enabled, graphql spans are now named after the operation type (GraphQL query), or GraphQL Operation where the SDK has no operation type, instead of after the client-supplied operation name or resolver field path. useOperationNameForRootSpan also no longer renames the enclosing root span. Every graphql span now carries graphql.processing.type, which says whether it is a parse, validate, execute or resolve span.

Why

Span names must be low cardinality when span streaming is enabled, and the operation name and field path both come from the client. A low-cardinality name cannot also say which part of request processing a span covers, so graphql.processing.type carries that instead, following the GraphQL OpenTelemetry Working Group proposal in open-telemetry/semantic-conventions#3515. Blocked on getsentry/sentry-conventions#572, which defines the attribute; the key is inlined until that ships.

Closes: #23526

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 kB - -
@sentry/browser - with treeshaking flags 26.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB - -
@sentry/browser (incl. Tracing) 48.34 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.36 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.25 kB - -
@sentry/browser (incl. Tracing, Replay) 87.74 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.2 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.45 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.13 kB - -
@sentry/browser (incl. Feedback) 45.81 kB - -
@sentry/browser (incl. sendFeedback) 33.36 kB - -
@sentry/browser (incl. FeedbackAsync) 38.47 kB - -
@sentry/browser (incl. Metrics) 29.52 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.45 kB - -
@sentry/react 30.33 kB - -
@sentry/react (incl. Tracing) 50.52 kB - -
@sentry/vue 35.4 kB - -
@sentry/vue (incl. Tracing) 50.32 kB - -
@sentry/svelte 28.6 kB - -
CDN Bundle 30.32 kB - -
CDN Bundle (incl. Tracing) 48.87 kB - -
CDN Bundle (incl. Logs, Metrics) 32.54 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.74 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.91 kB - -
CDN Bundle (incl. Tracing, Replay) 86.33 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.16 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.07 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94 kB - -
CDN Bundle - uncompressed 89.94 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.13 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.23 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 151.81 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.18 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.4 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.07 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.09 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 284.76 kB - -
@sentry/nextjs (client) 53.06 kB - -
@sentry/sveltekit (client) 48.76 kB - -
@sentry/core/server 64.95 kB - -
@sentry/core/browser 52.11 kB - -
@sentry/node 117.62 kB +0.14% +158 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.18 kB - -
@sentry/node - without tracing 82.03 kB +0.03% +24 B 🔺
@sentry/aws-serverless 91.46 kB +0.03% +22 B 🔺
@sentry/cloudflare (withSentry) - minified 194.68 kB - -
@sentry/cloudflare (withSentry) 481.3 kB - -

View base workflow run

andreiborza and others added 2 commits August 24, 2026 21:13
With span streaming enabled, name graphql spans after the operation type
or the graphql phase, and stop renaming the enclosing root span with the
operation. Names are unchanged in static mode.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013bjBXkGkJo8eL8hkz48byi
….processing.type

Follows the GraphQL OpenTelemetry Working Group, which added a dedicated
attribute for the processing type rather than widening
graphql.operation.type. Parse, validate and resolve spans take the static
fallback name and carry the phase as an attribute instead.

Claude-Session: https://claude.ai/code/session_013bjBXkGkJo8eL8hkz48byi
@andreiborza
andreiborza force-pushed the ab/graphql-low-cardinality-span-names branch from f11596c to ca3bd08 Compare August 24, 2026 19: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 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 ca3bd08. Configure here.

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.

Emit low cardinality graphql span names

1 participant