Align tracing semconv usage and enrich OTel span attributes#6847
Merged
Conversation
5 tasks
Copilot
AI
changed the title
[WIP] Review OpenTelemetry Go Module integration
Align tracing semconv usage and enrich OTel span attributes
Jun 1, 2026
13 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the gateway’s OpenTelemetry tracing helpers to consistently use a single semantic conventions package version and enriches spans with additional standardized attributes to improve observability.
Changes:
- Standardize tracing helpers and tests on
go.opentelemetry.io/otel/semconv/v1.34.0(removing mixed semconv usage). - Enrich error spans with
error.typeand MCP tool-call spans withgen_ai.system="mcp". - Bump OpenTelemetry Go modules to
v1.44.0and refresh module metadata (go.mod/go.sum).
Show a summary per file
| File | Description |
|---|---|
| internal/tracing/span_helpers.go | Align semconv import; add error.type on errors and gen_ai.system on tool-call spans. |
| internal/tracing/span_helpers_test.go | Extend tests to assert the new error.type and gen_ai.system attributes. |
| internal/tracing/genai_attrs.go | Re-export GenAISystem key alongside existing gen_ai.* helpers for consistent usage. |
| go.mod | Bump OpenTelemetry modules to v1.44.0 and update related dependencies. |
| go.sum | Update checksums to reflect the refreshed dependency graph after version bumps. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/5 changed files
- Comments generated: 0
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.
This updates the OpenTelemetry tracing integration to remove mixed semantic convention versions in
internal/tracingand pick up the current OTel Go release. It also fills two observability gaps called out in the review: structurederror.typeon error spans andgen_ai.systemon MCP tool-call spans.Tracing semconv alignment
internal/tracing/span_helpers.goand its tests onsemconv/v1.34.0v1.27.0usage so tracing code emits a consistent schema versionSpan enrichment
RecordSpanErrornow setserror.typein addition to recording the exception and span statusStartToolCallSpannow includesgen_ai.system="mcp"on tool-call spansGenAISystemalongside the existinggen_ai.*helpers for consistent use across tracing codeDependency update
v1.44.0Focused test updates
error.typeandgen_ai.systemattributes