Skip to content

Add A365 observability components - #35

Merged
Radhika Gupta (rads-1996) merged 13 commits into
microsoft:mainfrom
rads-1996:add-a365-exporter
Apr 17, 2026
Merged

Radhika Gupta (rads-1996) merged 13 commits into
microsoft:mainfrom
rads-1996:add-a365-exporter

Conversation

@rads-1996

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Agent365 (A365) observability/export components and hosting middleware to the Microsoft OpenTelemetry distro, including new runtime/core utilities and extensive unit test coverage.

Changes:

  • Extend use_microsoft_opentelemetry() with enable_a365 + optional token resolver support and append A365 span processors.
  • Introduce A365 observability runtime + hosting utilities (token cache, scope helpers, middleware) and core tracing/exporter infrastructure.
  • Add comprehensive tests for A365 exporters/processors/middleware plus update dependencies and dev test tooling.

Reviewed changes

Copilot reviewed 90 out of 92 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/test_distro.py Adds distro-level tests for enable_a365 passthrough and component appending.
tests/a365/test_utils.py Unit tests for exporter utility helpers (IDs, truncation, URL building, env parsing).
tests/a365/test_span_processor.py Tests for A365 baggage/identity span processor behavior.
tests/a365/test_handler.py Tests for is_a365_enabled() and create_a365_components() behavior from env.
tests/a365/test_exporter.py Tests for _Agent365Exporter export behavior, partitioning, and URL override.
tests/a365/test_enriching_span_processor.py Tests span enricher registration and enriching processor behavior.
tests/a365/runtime/test_version_utils.py Tests deprecated build_version() behavior + warning.
tests/a365/runtime/test_power_platform_api_discovery.py Tests endpoint discovery rules and validation.
tests/a365/runtime/test_operation_result.py Tests OperationResult success/failed behavior.
tests/a365/runtime/test_operation_error.py Tests OperationError validation and stringification.
tests/a365/runtime/test_environment_utils.py Tests scope override and environment detection.
tests/a365/runtime/init.py Adds package marker for runtime tests.
tests/a365/hosting/token_cache_helpers/test_agent_token_cache.py Tests async token cache registration/retrieval and thread safety.
tests/a365/hosting/token_cache_helpers/init.py Adds package marker for token cache helper tests.
tests/a365/hosting/scope_helpers/test_scope_helper_utils.py Tests extraction helpers for caller/agent/channel/conversation pairs.
tests/a365/hosting/scope_helpers/test_populate_invoke_agent_scope.py Tests populating InvokeAgent scope from hosting TurnContext.
tests/a365/hosting/scope_helpers/test_populate_baggage.py Tests baggage population from hosting TurnContext.
tests/a365/hosting/scope_helpers/init.py Adds package marker for scope helper tests.
tests/a365/hosting/middleware/test_output_logging_middleware.py Tests output logging middleware behavior and error handling.
tests/a365/hosting/middleware/test_observability_hosting_manager.py Tests hosting manager singleton/configuration behavior.
tests/a365/hosting/middleware/test_baggage_middleware.py Tests baggage middleware propagation and skip rules.
tests/a365/hosting/middleware/init.py Adds package marker for middleware tests.
tests/a365/hosting/init.py Adds package marker for hosting tests.
tests/a365/init.py Adds package marker for A365 tests.
src/microsoft/opentelemetry/_distro.py Adds enable_a365 + token resolver support and _append_a365_components().
src/microsoft/opentelemetry/_constants.py Adds new distro kwargs constants for A365 enable + token resolver.
src/microsoft/agents/a365/observability/runtime/version_utils.py Adds deprecated version helper (env-based) with warning.
src/microsoft/agents/a365/observability/runtime/utility.py Adds runtime utility helpers (token parsing, app name resolution).
src/microsoft/agents/a365/observability/runtime/power_platform_api_discovery.py Adds Power Platform API endpoint discovery helper.
src/microsoft/agents/a365/observability/runtime/operation_result.py Adds OperationResult implementation with singleton success.
src/microsoft/agents/a365/observability/runtime/operation_error.py Adds OperationError wrapper class.
src/microsoft/agents/a365/observability/runtime/environment_utils.py Adds environment/scope utility functions.
src/microsoft/agents/a365/observability/runtime/init.py Exposes runtime utilities as public API.
src/microsoft/agents/a365/observability/hosting/token_cache_helpers/agent_token_cache.py Adds per-(agent,tenant) async token cache and registration validation.
src/microsoft/agents/a365/observability/hosting/token_cache_helpers/init.py Exports hosting token cache helpers.
src/microsoft/agents/a365/observability/hosting/scope_helpers/utils.py Adds Activity-to-attribute pair extraction helpers.
src/microsoft/agents/a365/observability/hosting/scope_helpers/populate_invoke_agent_scope.py Adds TurnContext → InvokeAgentScope population.
src/microsoft/agents/a365/observability/hosting/scope_helpers/populate_baggage.py Adds TurnContext → BaggageBuilder population.
src/microsoft/agents/a365/observability/hosting/scope_helpers/init.py Adds hosting scope helper package marker.
src/microsoft/agents/a365/observability/hosting/middleware/output_logging_middleware.py Adds middleware emitting OutputScope spans for outgoing activities.
src/microsoft/agents/a365/observability/hosting/middleware/observability_hosting_manager.py Adds singleton manager to register hosting middlewares.
src/microsoft/agents/a365/observability/hosting/middleware/baggage_middleware.py Adds middleware that sets baggage for downstream turn logic.
src/microsoft/agents/a365/observability/hosting/middleware/init.py Exports hosting middleware public API.
src/microsoft/agents/a365/observability/hosting/init.py Exports hosting package public API.
src/microsoft/agents/a365/observability/core/utils.py Adds shared utility helpers (context extract, json, exception recording, etc.).
src/microsoft/agents/a365/observability/core/trace_processor/util.py Defines attribute allowlists for baggage→span propagation.
src/microsoft/agents/a365/observability/core/trace_processor/span_processor.py Adds baggage-to-attribute span processor (trace_processor variant).
src/microsoft/agents/a365/observability/core/trace_processor/init.py Exports trace processor API.
src/microsoft/agents/a365/observability/core/tool_type.py Adds tool type enum.
src/microsoft/agents/a365/observability/core/tool_call_details.py Adds tool call details dataclass.
src/microsoft/agents/a365/observability/core/spans_scopes/output_scope.py Adds OutputScope span wrapper for output message telemetry.
src/microsoft/agents/a365/observability/core/spans_scopes/init.py Adds spans_scopes package marker.
src/microsoft/agents/a365/observability/core/span_details.py Adds SpanDetails dataclass for parent context/timing/kind/links.
src/microsoft/agents/a365/observability/core/request.py Adds request context dataclass for scopes.
src/microsoft/agents/a365/observability/core/opentelemetry_scope.py Adds base scope implementation for span lifecycle and tagging.
src/microsoft/agents/a365/observability/core/models/user_details.py Adds user details model.
src/microsoft/agents/a365/observability/core/models/service_endpoint.py Adds endpoint model.
src/microsoft/agents/a365/observability/core/models/response.py Adds response model supporting structured tool results.
src/microsoft/agents/a365/observability/core/models/operation_source.py Adds operation source enum.
src/microsoft/agents/a365/observability/core/models/messages.py Adds OTEL gen-ai structured message types and wrappers.
src/microsoft/agents/a365/observability/core/models/caller_details.py Adds caller details composite model.
src/microsoft/agents/a365/observability/core/models/agent_type.py Adds agent type enum.
src/microsoft/agents/a365/observability/core/models/init.py Adds models package marker.
src/microsoft/agents/a365/observability/core/middleware/baggage_builder.py Adds baggage builder + scope context manager.
src/microsoft/agents/a365/observability/core/middleware/init.py Exports core middleware API.
src/microsoft/agents/a365/observability/core/message_utils.py Adds conversion/serialization helpers for structured messages.
src/microsoft/agents/a365/observability/core/invoke_agent_scope.py Adds InvokeAgentScope span wrapper with input/output message recording.
src/microsoft/agents/a365/observability/core/invoke_agent_details.py Adds invoke-agent scope details model.
src/microsoft/agents/a365/observability/core/inference_scope.py Adds inference scope span wrapper.
src/microsoft/agents/a365/observability/core/inference_operation_type.py Adds inference operation type enum.
src/microsoft/agents/a365/observability/core/inference_call_details.py Adds inference call details model.
src/microsoft/agents/a365/observability/core/exporters/spectra_exporter_options.py Adds OTLP-to-sidecar exporter configuration.
src/microsoft/agents/a365/observability/core/exporters/span_processor.py Adds A365 span processor (vendored) for identity stamping + baggage propagation.
src/microsoft/agents/a365/observability/core/exporters/enriching_span_processor.py Adds exporter pipeline span enrichment and optional suppression logic.
src/microsoft/agents/a365/observability/core/exporters/enriched_span.py Adds wrapper for enriching immutable ReadableSpan attributes.
src/microsoft/agents/a365/observability/core/exporters/agent365_exporter_options.py Adds Agent365 exporter configuration model.
src/microsoft/agents/a365/observability/core/exporters/agent365_exporter.py Adds Agent365 HTTP span exporter implementation.
src/microsoft/agents/a365/observability/core/exporters/init.py Adds exporters package marker.
src/microsoft/agents/a365/observability/core/execute_tool_scope.py Adds tool execution scope span wrapper.
src/microsoft/agents/a365/observability/core/constants.py Adds core semantic convention keys and feature switches.
src/microsoft/agents/a365/observability/core/config.py Adds telemetry manager + configure/exporter wiring.
src/microsoft/agents/a365/observability/core/channel.py Adds channel model.
src/microsoft/agents/a365/observability/core/agent_details.py Adds agent details model.
src/microsoft/agents/a365/observability/core/init.py Exposes core observability API surface.
src/microsoft/agents/a365/observability/constants.py Adds top-level constants superset (core + distro env vars).
src/microsoft/agents/a365/observability/init.py Exposes A365 distro integration API (create_a365_components, etc.).
pyproject.toml Adds runtime dependencies for A365 + OTLP gRPC exporter.
dev_requirements.txt Adds pytest-asyncio for async test execution.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
Comment thread pyproject.toml
Comment thread src/microsoft/agents/a365/observability/runtime/utility.py
Comment thread src/microsoft/opentelemetry/_distro.py
Comment thread dev_requirements.txt
@rads-1996
Radhika Gupta (rads-1996) merged commit 8ac1713 into microsoft:main Apr 17, 2026
11 checks passed
@rads-1996
Radhika Gupta (rads-1996) deleted the add-a365-exporter branch April 17, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants