Skip to content

Conversation

@stephentoub
Copy link
Member

@stephentoub stephentoub commented Oct 30, 2025

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

@stephentoub stephentoub requested a review from a team as a code owner October 30, 2025 00:32
Copilot AI review requested due to automatic review settings October 30, 2025 00:32
@github-actions github-actions bot added the area-ai Microsoft.Extensions.AI libraries label Oct 30, 2025
Copy link
Contributor

Copilot AI left a 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 DeriveModalityFromMediaType helper 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

@stephentoub
Copy link
Member Author

@JamesNK, now that there's an official standard for it, it'd be cool if Aspire could render blobs/uris with appropriate media types.

@stephentoub stephentoub merged commit 8e4a3e2 into dotnet:main Oct 30, 2025
6 checks passed
@stephentoub stephentoub deleted the otel138 branch October 30, 2025 12:58
jeffhandley pushed a commit to jeffhandley/extensions that referenced this pull request Nov 1, 2025
This was referenced Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-ai Microsoft.Extensions.AI libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants