feat(attributes): Add graphql.processing.type - #572
Merged
Merged
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
🤖 This preview updates automatically when you update the PR. |
andreiborza
force-pushed
the
ab/graphql-processing-type
branch
from
August 24, 2026 18:26
d142a45 to
c2cf549
Compare
andreiborza
marked this pull request as ready for review
August 24, 2026 18:40
andreiborza
requested review from
a team,
Lms24,
cleptric,
mjq and
nsdeschenes
as code owners
August 24, 2026 18:40
mjq
approved these changes
Aug 24, 2026
Lms24
approved these changes
Aug 25, 2026
Identifies which part of GraphQL request processing a span represents (parse, validate, execute, resolve and so on), so consumers do not have to read it out of the span name. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013bjBXkGkJo8eL8hkz48byi
Also replaces the `mutation`/`query` examples, which no template can produce since Sentry prefixes GraphQL span names with `GraphQL `. Claude-Session: https://claude.ai/code/session_013bjBXkGkJo8eL8hkz48byi
andreiborza
force-pushed
the
ab/graphql-processing-type
branch
from
August 25, 2026 11:35
d87ac93 to
1cdfe40
Compare
Lms24
approved these changes
Aug 25, 2026
andreiborza
added a commit
to getsentry/sentry-javascript
that referenced
this pull request
Aug 25, 2026
## What With span streaming enabled, graphql spans are now named after the operation type (`GraphQL query`), or after the processing type where there is none (`GraphQL parse`, `GraphQL resolve`), 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 https://claude.ai/code/session_013bjBXkGkJo8eL8hkz48byi --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
4 tasks
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.
Description
Adds
graphql.processing.type, which says which part of GraphQL request processing a span represents:parse,validate,execute,resolveand so on. Adds it to thegraphqlspan name templates as well, so the phases get a name of their own:GraphQL span names are low cardinality and carry the operation type at most, so a parse span and a validate span are otherwise indistinguishable. A parse span carries no GraphQL attribute at all today.
Both attributes are set on an operation span, and only
graphql.processing.typeon the phases, so the template order keepsGraphQL queryfor operations and givesGraphQL parse/GraphQL validate/GraphQL resolveto the rest.Also replaces the
mutationandqueryexamples, which no template can produce since Sentry prefixes GraphQL span names withGraphQL, as theotel_noteson the same entry says. They predate that prefix.The attribute name and its value list follow the GraphQL OpenTelemetry Working Group proposal in open-telemetry/semantic-conventions#3515. That PR is still a working draft, so
is_in_otelisfalsefor now and should be flipped once it lands upstream. Note that the working group deliberately did not widengraphql.operation.typefor this, since that attribute holds the GraphQL operation type (query,mutation,subscription) and applies only to spans that run an operation.@sentry/javascriptwants this for getsentry/sentry-javascript#23542, where streamed GraphQL spans lose the operation name and the resolver field path from their names.PR Checklist
yarn testand verified that the tests pass.yarn generateto generate and format code and docs.If an attribute was added:
nextjs.function_id, notfunction_id)apply_scrubbing(i.e.manualorauto. Useneveronly for values that should never be scrubbed such as IDs)