-
Notifications
You must be signed in to change notification settings - Fork 841
Update to 1.38 of the otel genai standard convention #6981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the OpenTelemetry implementations in Microsoft.Extensions.AI to align with the Semantic Conventions for Generative AI systems v1.38. The key changes include refactoring how content parts are serialized for telemetry, introducing specific part types (blob, uri, file) to replace the generic representation, and adding a new comprehensive test to verify all official OpenTelemetry content part types are serialized correctly.
- Updates version references from v1.37 to v1.38 in documentation comments
- Introduces three new structured part types (
OtelBlobPart,OtelUriPart,OtelFilePart) to replace generic serialization - Adds
DeriveModalityFromMediaTypehelper method to extract modality from MIME types - Adds comprehensive test coverage for all official OpenTelemetry content part types in both streaming and non-streaming scenarios
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| OpenTelemetryChatClient.cs | Core implementation changes: adds new part types, modality derivation logic, and updates serialization to use structured formats per OpenTelemetry v1.38 spec |
| OpenTelemetryImageGenerator.cs | Updates version reference in documentation from v1.37 to v1.38 |
| OpenTelemetryEmbeddingGenerator.cs | Updates version reference in documentation from v1.37 to v1.38 |
| OpenTelemetrySpeechToTextClient.cs | Updates version reference in documentation from v1.37 to v1.38 |
| OpenTelemetryChatClientTests.cs | Adds comprehensive test verifying all official content part types serialize correctly; updates existing test expectations for new serialization format |
| OpenTelemetryImageGeneratorTests.cs | Updates test expectations to match new serialization format with blob, uri, and file part types |
src/Libraries/Microsoft.Extensions.AI/ChatCompletion/OpenTelemetryChatClient.cs
Show resolved
Hide resolved
|
@JamesNK, now that there's an official standard for it, it'd be cool if Aspire could render blobs/uris with appropriate media types. |
https://github.com/open-telemetry/semantic-conventions/releases/tag/v1.38.0
These blob, file, and uri parts just got added to the spec earlier today and were the only updates for 1.38 we didn't yet incorporate.
Microsoft Reviewers: Open in CodeFlow