-
Notifications
You must be signed in to change notification settings - Fork 841
Update OpenTelemetryChatClient to output data on all tools #6906
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 integration for chat clients to emit telemetry data for all types of AI tools, not just function declarations. Previously, the system only captured telemetry for AIFunctionDeclaration tools, but now it handles function wrappers and emits tool names as types for other tool varieties.
Key changes:
- Enhanced tool telemetry logic to support all tool types through pattern matching
- Added
Nameproperty implementations to hosted tool classes for proper identification - Updated test coverage to validate telemetry output for various tool types
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| OpenTelemetryChatClient.cs | Updated telemetry logic to handle all tool types with pattern matching and made Parameters nullable |
| HostedWebSearchTool.cs | Added Name property override returning "web_search" |
| HostedFileSearchTool.cs | Added Name property override returning "file_search" |
| HostedCodeInterpreterTool.cs | Added Name property override returning "code_interpreter" |
| HostedMcpServerTool.cs | Added Name property override returning "mcp" |
| OpenTelemetryChatClientTests.cs | Added test cases for new tool types and their expected telemetry output |
| Microsoft.Extensions.AI.Abstractions.json | Updated API baseline manifest with new Name property definitions |
We're currently filtering down to only AITools that are AIFunctionDeclaration. With this, we'll handle AIFunctionDeclaration wrappers the same as well, and for all other tools emit their name as the type. This can be further extended as otel adds more details about how non-function tools should be represented.
We're currently filtering down to only AITools that are AIFunctionDeclaration. With this, we'll handle AIFunctionDeclaration wrappers the same as well, and for all other tools emit their name as the type. This can be further extended as otel adds more details about how non-function tools should be represented.
We're currently filtering down to only AITools that are AIFunctionDeclaration. With this, we'll handle AIFunctionDeclaration wrappers the same as well, and for all other tools emit their name as the type. This can be further extended as otel adds more details about how non-function tools should be represented.
We're currently filtering down to only AITools that are AIFunctionDeclaration. With this, we'll handle AIFunctionDeclaration wrappers the same as well, and for all other tools emit their name as the type. This can be further extended as otel adds more details about how non-function tools should be represented.
We're currently filtering down to only AITools that are AIFunctionDeclaration. With this, we'll handle AIFunctionDeclaration wrappers the same as well, and for all other tools emit their name as the type. This can be further extended as otel adds more details about how non-function tools should be represented.
Microsoft Reviewers: Open in CodeFlow