Update to genai standard convention 1.37#6767
Merged
stephentoub merged 1 commit intodotnet:mainfrom Sep 3, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates the OpenTelemetry instrumentation in Microsoft.Extensions.AI to conform to the latest 1.37.0 draft specification of the Semantic Conventions for Generative AI systems. The changes include updating tag names and replacing logging-based telemetry with activity tags for better structured data.
- Updated OpenTelemetry semantic conventions from v1.36 to v1.37
- Replaced logging-based telemetry with structured activity tags for messages
- Standardized provider-specific tag naming conventions
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| OpenTelemetryConsts.cs | Updated constant definitions to align with v1.37 conventions, added new message-related constants |
| OpenTelemetryChatClient.cs | Replaced logging with activity tags for message serialization and updated tag names |
| OpenTelemetryEmbeddingGenerator.cs | Updated tag names and variable naming to match new conventions |
| FunctionInvokingChatClient.cs | Updated to use constants for operation name and tool type |
| Test files | Updated test assertions to match new tag naming conventions |
| CHANGELOG.md | Added entry documenting the OpenTelemetry update |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/Libraries/Microsoft.Extensions.AI/ChatCompletion/OpenTelemetryChatClient.cs
Show resolved
Hide resolved
test/Libraries/Microsoft.Extensions.AI.Tests/ChatCompletion/OpenTelemetryChatClientTests.cs
Show resolved
Hide resolved
eiriktsarpalis
approved these changes
Sep 3, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
https://github.com/open-telemetry/semantic-conventions/releases/tag/v1.37.0
Microsoft Reviewers: Open in CodeFlow