Skip to content

Conversation

stephentoub
Copy link
Member

@stephentoub stephentoub commented Sep 19, 2025

open-telemetry/semantic-conventions#2362
open-telemetry/semantic-conventions#2702

gen_ai.embeddings.dimension.count
gen_ai.tool.call.arguments
gen_ai.tool.call.result
gen_ai.tool.definitions

Microsoft Reviewers: Open in CodeFlow

@stephentoub stephentoub requested a review from a team as a code owner September 19, 2025 21:14
@Copilot Copilot AI review requested due to automatic review settings September 19, 2025 21:14
@github-actions github-actions bot added the area-ai Microsoft.Extensions.AI libraries label Sep 19, 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 updates the OpenTelemetry implementation for generative AI to align with recent additions to the OpenTelemetry semantic conventions. The changes include updating attribute names, adding support for tool call tracking with arguments and results, and introducing tool definitions telemetry.

  • Updates attribute names to match the latest semantic conventions (e.g., gen_ai.request.embedding.dimensionsgen_ai.embeddings.dimension.count)
  • Adds support for tracking tool call arguments and results in telemetry when sensitive data is enabled
  • Introduces tool definitions tracking for chat completion requests

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
OpenTelemetryConsts.cs Updates constant names and adds new attributes for tool calls and embeddings
OpenTelemetryEmbeddingGenerator.cs Updates to use new embedding dimension attribute name
OpenTelemetryChatClient.cs Adds tool definitions tracking and updates operation name constants
OpenTelemetryImageGenerator.cs Updates operation name constants for consistency
FunctionInvokingChatClient.cs Adds tool call arguments and results tracking with proper sensitive data handling
Test files Updates tests to verify new telemetry attributes and adds test coverage for tool tracking
AIFunctionDeclaration.cs Minor documentation update for JSON schema example

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

@stephentoub stephentoub enabled auto-merge (squash) September 19, 2025 22:20
@stephentoub stephentoub merged commit 6e61568 into dotnet:main Sep 22, 2025
6 checks passed
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