Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR standardizes telemetry span/metric naming and attributes across hosting-core, improves span error recording and success tracking, and adds new spans/metrics coverage via tests.
Changes:
- Standardized span names/attributes (snake_case, consistent keys) and added a
successattribute for turn telemetry. - Added/updated span wrappers (e.g.,
AdapterWriteResponse,TurnContextSendActivities) and adjusted storage metric attributes to use short operation names. - Expanded telemetry unit tests for connector, adapter, storage, and user-token client spans.
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/hosting_core/telemetry/test_user_token_client_spans.py | Adds coverage for user token client spans/metrics + error status behavior |
| tests/hosting_core/telemetry/test_turn_context_spans.py | Updates tests for renamed TurnContext send-activities span |
| tests/hosting_core/telemetry/test_storage_spans.py | Adds assertions for storage.operation metric attribute values |
| tests/hosting_core/telemetry/test_simple_span_wrapper.py | Removes completion-event test now that completion event was removed |
| tests/hosting_core/telemetry/test_http_adapter_telemetry.py | Adds end-to-end adapter telemetry tests for multiple code paths |
| tests/hosting_core/telemetry/test_connector_spans.py | Adds connector span/metric coverage for multiple operations |
| tests/hosting_core/telemetry/test_app_spans.py | Adds test that turn duration is recorded on error path |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/turn_context.py | Wraps send_activities with a telemetry span |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/telemetry/turn_context/spans.py | Renames span wrapper to TurnContextSendActivities and updates span constant |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/telemetry/turn_context/constants.py | Renames span name constant to agents.turn.send_activities |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/telemetry/core/_agents_telemetry.py | Removes completion event, records exceptions explicitly, configures tracer span behavior |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/telemetry/attributes.py | Updates IS_AGENTIC attribute key and adds SUCCESS |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/telemetry/adapter/spans.py | Adds AdapterWriteResponse span wrapper |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/telemetry/adapter/constants.py | Adds SPAN_WRITE_RESPONSE constant |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/storage/telemetry/spans.py | Changes storage metrics to use short operation names + adds span attribute |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/state/agent_state.py | Caches default factory values to track modifications |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/http/_http_adapter_base.py | Wraps invoke/expectReplies response writing in new adapter span |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/telemetry/user_token_client_spans.py | Refactors attribute map creation for token client spans |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/telemetry/constants.py | Standardizes connector span names to snake_case |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/connector/client/connector_client.py | Refactors update_activity request/response handling (introduces a bug) |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/telemetry/constants.py | Standardizes auth span names under agents.authentication.* |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/telemetry/spans.py | Adds success attr and records duration on error path |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/oauth/telemetry/constants.py | Renames oauth metric constants for sign-in/out |
| libraries/microsoft-agents-activity/microsoft_agents/activity/suggested_actions.py | Sets default value for SuggestedActions.to |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…into users/robrandao/telemetry-update
…/microsoft/Agents-for-python into users/robrandao/telemetry-update
MattB-msft
approved these changes
Apr 15, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 24 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request makes several improvements and corrections to telemetry, tracing, and metrics across the agents hosting core libraries. The main themes are standardizing span and metric names, improving attribute consistency, enhancing error handling and success tracking, and adding new telemetry for key operations. These changes will make telemetry data more consistent, easier to analyze, and more reliable for debugging and monitoring.
Telemetry naming and attribute standardization:
SPAN_REPLY_TO_ACTIVITYis now"agents.connector.reply_to_activity", andSPAN_TURN_SEND_ACTIVITYis now"agents.turn.send_activities"). [1] [2] [3] [4] [5]IS_AGENTICis now"activity.is_agentic_request"and added a newSUCCESSattribute). [1] [2]Improved telemetry recording and error handling:
SUCCESSattribute to span metrics and ensured that turn duration is recorded on both success and error paths. Also, exceptions are now recorded on error. [1] [2] [3] [4] [5]New and enhanced telemetry spans:
AdapterWriteResponsespan to capture when anInvokeResponseis written in the adapter, including metrics for activities sent. [1] [2] [3]send_activitiesinTurnContext, improving visibility into activity sends. [1] [2]Storage telemetry improvements:
"read","write","delete") as attributes, improving clarity and consistency in storage operation metrics. [1] [2]Other fixes and improvements:
SuggestedActions.to).These changes collectively make telemetry data more robust, easier to interpret, and better aligned with best practices for observability.