Skip to content

Conversation

@M-Hietala
Copy link
Contributor

update operation name add support for message attributes

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 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

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure-ai-projects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant