-
Notifications
You must be signed in to change notification settings - Fork 3.2k
update operation name add support for message attributes #44979
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
base: main
Are you sure you want to change the base?
update operation name add support for message attributes #44979
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 pull request updates operation names and adds support for message attributes in the Azure AI Projects SDK telemetry instrumentation. The changes enable toggling between event-based and attribute-based message tracing modes.
Changes:
- Updated operation names from "responses" to "chat" for model calls and "invoke_agent" for agent calls
- Added support for message attributes (gen_ai.input.messages and gen_ai.output.messages) as an alternative to events
- Introduced runtime configuration to switch between events mode and attributes mode via _set_use_message_events()
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| _utils.py | Added new constants for operation names (OPERATION_NAME_CHAT, OPERATION_NAME_INVOKE_AGENT) and message attributes (GEN_AI_INPUT_MESSAGES, GEN_AI_OUTPUT_MESSAGES), plus configuration functions |
| _responses_instrumentor.py | Modified to support both event-based and attribute-based message tracing with conditional logic based on _get_use_message_events() |
| test_responses_instrumentor_mcp_async.py | Refactored tests to validate both events and attributes modes, but contains duplicate "az.namespace" attributes in 8 locations |
| test_responses_instrumentor_mcp.py | Refactored tests to validate both events and attributes modes, but contains duplicate "az.namespace" attributes in 6 locations |
| test_responses_instrumentor_workflow_async.py | Updated to use new constants and added _set_use_message_events(True) calls |
| test_responses_instrumentor_workflow.py | Updated to use new constants and added _set_use_message_events(True) calls |
| test_responses_instrumentor_file_search_async.py | Updated to use new constants and added _set_use_message_events(True) calls |
| test_responses_instrumentor_file_search.py | Updated to use new constants and added _set_use_message_events(True) calls |
| test_responses_instrumentor_code_interpreter_async.py | Updated to use new constants and added _set_use_message_events(True) calls |
| test_responses_instrumentor_code_interpreter.py | Updated to use new constants and added _set_use_message_events(True) calls |
| test_responses_instrumentor_browser_automation_async.py | Updated to use new constants and added _set_use_message_events(True) calls |
| test_responses_instrumentor_browser_automation.py | Updated to use new constants and added _set_use_message_events(True) calls |
| test_responses_instrumentor_async.py | Refactored tests to support both modes with comprehensive test coverage |
| test_responses_instrumentor.py | Refactored tests to support both modes with comprehensive test coverage |
| assets.json | Updated asset tag |
| CHANGELOG.md | Documented the breaking changes |
sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp_async.py
Show resolved
Hide resolved
sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp_async.py
Show resolved
Hide resolved
sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp.py
Show resolved
Hide resolved
sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp.py
Show resolved
Hide resolved
sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp.py
Show resolved
Hide resolved
sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp_async.py
Show resolved
Hide resolved
sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp_async.py
Show resolved
Hide resolved
sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp.py
Show resolved
Hide resolved
sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp.py
Show resolved
Hide resolved
sdk/ai/azure-ai-projects/tests/agents/telemetry/test_responses_instrumentor_mcp_async.py
Show resolved
Hide resolved
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
update operation name add support for message attributes