Skip to content

Conversation

stephentoub
Copy link
Member

@stephentoub stephentoub commented Sep 6, 2025

For historical reasons (based on older versions of the genai convention), we were mangling the key names. Now just use the key names as sourced from the dictionary, enabling a developer to more easily augment the spans with data of their choice.

#6771

Microsoft Reviewers: Open in CodeFlow

…al properties

For historical reasons (based on older versions of the genai convention), we were mangling the key names. Now just use the key names as sourced from the dictionary, enabling a developer to more easily augment the spans with data of their choice.
@stephentoub stephentoub requested a review from a team as a code owner September 6, 2025 00:34
@github-actions github-actions bot added the area-ai Microsoft.Extensions.AI libraries label Sep 6, 2025
Copy link
Contributor

@Copilot 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 simplifies OpenTelemetry logging by removing key name mangling and using raw property names from additional properties dictionaries. Previously, the code was transforming key names using snake_case conversion and provider-specific prefixes, but now it logs additional properties with their original key names.

  • Removed provider-specific tag prefixes and snake_case conversion for additional properties
  • Updated test assertions to expect raw key names instead of mangled ones
  • Cleaned up unused helper methods and imports

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
OpenTelemetryChatClient.cs Simplified additional properties logging to use raw key names
OpenTelemetryEmbeddingGenerator.cs Simplified additional properties logging to use raw key names
OpenTelemetryConsts.cs Removed unused PerProvider helper methods
OpenTelemetryChatClientTests.cs Updated test assertions for new raw key format
OpenTelemetryEmbeddingGeneratorTests.cs Updated test assertions for new raw key format

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@jeffhandley jeffhandley left a comment

Choose a reason for hiding this comment

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

Could someone consider this to be a breaking change if they were doing post-processing on the keys or otherwise relying on the key names in the old structure?

@stephentoub
Copy link
Member Author

Could someone consider this to be a breaking change if they were doing post-processing on the keys or otherwise relying on the key names in the old structure?

Yes, but a) these pale in comparison to the changes made for the 1.37 update, and b) the whole impl is under an Experimental otel namespace because the spec is still changing.

@stephentoub stephentoub merged commit 3645ccc into dotnet:main Sep 6, 2025
7 checks passed
@stephentoub stephentoub deleted the addproplogging branch September 6, 2025 22:52
joperezr pushed a commit that referenced this pull request Sep 9, 2025
…al properties (#6776)

For historical reasons (based on older versions of the genai convention), we were mangling the key names. Now just use the key names as sourced from the dictionary, enabling a developer to more easily augment the spans with data of their choice.
@github-actions github-actions bot locked and limited conversation to collaborators Oct 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-ai Microsoft.Extensions.AI libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants