Skip to content

Adds GraphQL Semantic Convention from Otel Workgroup#3515

Open
PascalSenn wants to merge 7 commits intoopen-telemetry:mainfrom
PascalSenn:pse/update-graphql-specification
Open

Adds GraphQL Semantic Convention from Otel Workgroup#3515
PascalSenn wants to merge 7 commits intoopen-telemetry:mainfrom
PascalSenn:pse/update-graphql-specification

Conversation

@PascalSenn
Copy link
Copy Markdown

@PascalSenn PascalSenn commented Mar 7, 2026

Important

This is a working draft and is NOT intended to be merged yet. Final approval is still pending from both the OpenTelemetry Semantic Conventions maintainers and the GraphQL OpenTelemetry Working Group. This PR has been opened early to get feedback from the OTel side and be the base for discussion while the specification is being finalized.

Changes

This PR adds comprehensive GraphQL semantic conventions, developed by the GraphQL OpenTelemetry Working Group, to the OpenTelemetry Semantic Conventions repository.

Origin

This specification was developed in the graphql/graphql-wg otel-wg subcommittee over multiple working group sessions. Key contributors and participants include members from the GraphQL and OpenTelemetry communities working together to define instrumentation standards for GraphQL.

The specification intends to supersede the existing minimal GraphQL semantic conventions (previously only a single server span with 3 attributes) with a comprehensive convention covering the full GraphQL request lifecycle.

  • Cardinality-safe by default: graphql.operation.name is opt-in on metrics; graphql.document.hash and graphql.document.id are preferred identifiers
  • Phase-level observability: Separate spans and metrics for parse, validate, execute, and plan phases
  • Federated/advanced server support: Step execution spans, operation planning, and source attributes for distributed GraphQL systems
  • DataLoader support: Dedicated spans for batch operations with cache hit/miss tracking - Combined error+exception events: GraphQL errors caused by exceptions use a single event with both graphql.error.* and exception.* attributes
  • Subscription support: Dedicated subscription event spans and active subscription
    metrics, distinct from request-level tracking

People involved

This work was developed by the GraphQL OpenTelemetry Working Group, a subcommittee of the GraphQL Working Group. Participants include representatives from across the GraphQL ecosystem working on instrumentation standards.

Important

The workgroup meets every third week of the month on thursday Checkout the calendar
In case you want to join add yourself to the agenda over at GraphQL OpenTelemetry Working Group

Merge requirement checklist

  • CONTRIBUTING.md guidelines followed.
  • Change log entry added, according to the guidelines in When to add a changelog entry.
    • If your PR does not need a change log, start the PR title with [chore]
  • Links to the prototypes or existing instrumentations (when adding or changing conventions)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 7, 2026

This PR contains changes to area(s) that do not have an active SIG/project and will be auto-closed:

  • graphql

Such changes may be rejected or put on hold until a new SIG/project is established.

Please refer to the Semantic Convention Areas
document to see the current active SIGs and also to learn how to kick start a new one.

@github-actions github-actions Bot closed this Mar 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 7, 2026

This PR contains changes to area(s) that do not have an active SIG/project and will be auto-closed:

  • graphql

Such changes may be rejected or put on hold until a new SIG/project is established.

Please refer to the Semantic Convention Areas
document to see the current active SIGs and also to learn how to kick start a new one.

@PascalSenn
Copy link
Copy Markdown
Author

@trask Can you let me know the process to get this reviewed?

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 7, 2026

This PR contains changes to area(s) that do not have an active SIG/project and will be auto-closed:

  • graphql

Such changes may be rejected or put on hold until a new SIG/project is established.

Please refer to the Semantic Convention Areas
document to see the current active SIGs and also to learn how to kick start a new one.

@trask
Copy link
Copy Markdown
Member

trask commented Mar 10, 2026

re-opening for discussion!

@PascalSenn also check out open-telemetry/opentelemetry-specification#4906

there has been quite a bit of progress since we discussed last year about the option of hosting semantic conventions outside of this repository. I think the work is pretty bleeding edge still but may be ready for external usage soon. In the meantime, let's review and discuss the GraphQL semantic conventions here.

@trask trask reopened this Mar 10, 2026
Comment thread docs/graphql/graphql-metrics.md Outdated
Comment thread docs/graphql/graphql-metrics.md Outdated
Comment thread model/graphql/registry.yaml Outdated
Comment thread model/graphql/registry.yaml Outdated
Comment thread model/graphql/registry.yaml Outdated
Comment thread model/graphql/registry.yaml Outdated
Comment thread model/graphql/registry.yaml Outdated
Comment thread model/graphql/registry.yaml Outdated
Comment thread model/graphql/registry.yaml Outdated
Comment thread model/graphql/registry.yaml Outdated
Comment thread model/graphql/spans.yaml Outdated
Comment thread model/graphql/spans.yaml Outdated
Comment thread docs/graphql/graphql-metrics.md
@github-actions
Copy link
Copy Markdown

This PR has been labeled as stale due to lack of activity. It will be automatically closed if there is no further activity over the next 7 days.

Comment thread model/graphql/spans.yaml
Comment thread model/graphql/events.yaml Outdated
Comment thread model/graphql/events.yaml Outdated
PascalSenn added 2 commits May 2, 2026 18:40
…consistency

- Updated error attributes in events.yaml to clarify the relationship between GraphQL-specific error details and exception information.
- Renamed metrics in metrics.yaml for consistency, changing `active_requests` to `request.active`.
- Revised registry.yaml to enhance attribute descriptions and examples, including the addition of `graphql.document.locations` and renaming selection attributes to field attributes.
- Improved span definitions in spans.yaml to align with updated field naming conventions and clarified requirements for document IDs and hashes.
@PascalSenn
Copy link
Copy Markdown
Author

@thompson-tomo @trask can we reopen this PR?
I think there is only one comment left. I will present this to the TSC next week so hopefully we can get this in soon. (Ideally in the next couple of weeks)

@trask trask reopened this May 2, 2026
Comment thread docs/graphql/graphql-events.md Outdated
Comment thread model/graphql/spans.yaml
@github-actions github-actions Bot removed the Stale label May 3, 2026
Comment thread model/graphql/metrics.yaml Outdated
Comment thread model/graphql/spans.yaml Outdated
Comment thread model/graphql/events.yaml
Comment thread model/graphql/metrics.yaml
Copy link
Copy Markdown
Contributor

@thompson-tomo thompson-tomo left a comment

Choose a reason for hiding this comment

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

Just a couple of small doc tweaks which will need a fresh markdown generated.

Comment thread model/graphql/registry.yaml Outdated
Comment thread model/graphql/spans.yaml Outdated
Comment thread model/graphql/spans.yaml Outdated
Comment thread model/graphql/spans.yaml Outdated
Comment thread model/graphql/spans.yaml Outdated
Comment thread model/graphql/spans.yaml Outdated
Comment thread model/graphql/spans.yaml Outdated
Comment thread model/graphql/spans.yaml Outdated
Comment thread model/graphql/spans.yaml Outdated
Comment thread model/graphql/spans.yaml Outdated
PascalSenn and others added 2 commits May 7, 2026 18:09
Co-authored-by: James Thompson <thompson.tomo@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants