Skip to content

Move a365 and genai code under microsoft.opentelemetry namespace - #38

Merged
Hector Hernandez (hectorhdzg) merged 1 commit into
mainfrom
hectorhdzg/move-a365-genai-to-otel-namespace
Apr 17, 2026
Merged

Hector Hernandez (hectorhdzg) merged 1 commit into
mainfrom
hectorhdzg/move-a365-genai-to-otel-namespace

Conversation

@hectorhdzg

Copy link
Copy Markdown
Member
  • Moved microsoft.agents.a365.observability -> microsoft.opentelemetry.a365
  • Moved microsoft.genai -> microsoft.opentelemetry._genai
  • Updated all internal imports, test references, and pyproject.toml entry point
  • Removed intermediate agents/ and observability/ directory levels

- Moved microsoft.agents.a365.observability -> microsoft.opentelemetry.a365
- Moved microsoft.genai -> microsoft.opentelemetry._genai
- Updated all internal imports, test references, and pyproject.toml entry point
- Removed intermediate agents/ and observability/ directory levels
- Added README documenting a365 package structure
- All 667 tests passing

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

This PR relocates the Agent365 (a365) observability and GenAI/LangChain instrumentation code into the microsoft.opentelemetry namespace and updates tests/configuration accordingly, aligning these components under the distro’s primary package hierarchy.

Changes:

  • Move a365 modules from microsoft.agents.a365.observability to microsoft.opentelemetry.a365, and update all internal/test imports.
  • Move GenAI/LangChain instrumentation from microsoft.genai to microsoft.opentelemetry._genai and update the OTel instrumentor entry point.
  • Remove legacy package entrypoints (microsoft.agents.a365.observability.*) and add new modules/README under the new namespace.

Reviewed changes

Copilot reviewed 68 out of 95 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pyproject.toml Updates OTel instrumentor entry point to the new _genai namespace.
tests/test_distro.py Updates patch target for a365 component creation to the new namespace.
tests/langchain/test_utils.py Updates imports to the new _genai._langchain path.
tests/langchain/test_tracer_instrumentor.py Updates imports/patch targets to the new _genai._langchain path.
tests/langchain/test_tracer.py Updates imports/patch targets to the new _genai._langchain path.
tests/a365/test_utils.py Updates imports to new microsoft.opentelemetry.a365 package layout.
tests/a365/test_span_processor.py Updates imports and baggage key expectations to new a365 namespace/keys.
tests/a365/test_handler.py Updates imports and internal type assertions to new a365 namespace.
tests/a365/test_exporter.py Updates imports and patch paths for exporter internals.
tests/a365/test_enriching_span_processor.py Updates imports for enriching span processor module path.
tests/a365/runtime/test_version_utils.py Updates imports for runtime version utility module path.
tests/a365/runtime/test_utility.py Updates imports for runtime Utility module path.
tests/a365/runtime/test_power_platform_api_discovery.py Updates imports for Power Platform discovery helper path.
tests/a365/runtime/test_operation_result.py Updates runtime import path for OperationResult/OperationError.
tests/a365/runtime/test_operation_error.py Updates runtime import path for OperationError.
tests/a365/runtime/test_environment_utils.py Updates runtime import path for environment utils.
tests/a365/hosting/token_cache_helpers/test_agent_token_cache.py Updates imports for hosting token cache helpers path.
tests/a365/hosting/scope_helpers/test_scope_helper_utils.py Updates imports for scope-helper utilities/constants path.
tests/a365/hosting/scope_helpers/test_populate_invoke_agent_scope.py Updates imports for invoke-agent scope population helpers path.
tests/a365/hosting/scope_helpers/test_populate_baggage.py Updates imports for baggage population helpers path.
tests/a365/hosting/middleware/test_output_logging_middleware.py Updates imports/patch targets for output-logging middleware path.
tests/a365/hosting/middleware/test_observability_hosting_manager.py Updates imports for hosting manager/middleware path.
tests/a365/hosting/middleware/test_baggage_middleware.py Updates imports for baggage middleware/constants path.
src/microsoft/opentelemetry/_distro.py Updates a365 optional import and warning message to the new namespace.
src/microsoft/opentelemetry/_genai/init.py Adds _genai package init under the new namespace.
src/microsoft/opentelemetry/_genai/_langchain/init.py Updates LangChain instrumentor export to new namespace.
src/microsoft/opentelemetry/_genai/_langchain/_utils.py Adds (moved) LangChain run → span-attribute extraction utilities under new namespace.
src/microsoft/opentelemetry/_genai/_langchain/_tracer.py Updates internal imports to reference new _utils path.
src/microsoft/opentelemetry/_genai/_langchain/_tracer_instrumentor.py Updates tracer import to new namespace.
src/microsoft/opentelemetry/a365/init.py Re-exports a365 public handlers from new module location.
src/microsoft/opentelemetry/a365/README.md Adds package structure documentation for the relocated a365 SDK.
src/microsoft/opentelemetry/a365/constants.py Updates a365 constants (including custom attribute key strings) under new namespace.
src/microsoft/opentelemetry/a365/core/init.py Defines a365 core public API surface under new namespace.
src/microsoft/opentelemetry/a365/core/agent_details.py Adds/moves AgentDetails model.
src/microsoft/opentelemetry/a365/core/channel.py Adds/moves Channel model.
src/microsoft/opentelemetry/a365/core/config.py Updates imports and docs for new namespace; retains telemetry configuration logic.
src/microsoft/opentelemetry/a365/core/constants.py Updates core constants (including custom attribute key strings) under new namespace.
src/microsoft/opentelemetry/a365/core/execute_tool_scope.py Updates imports for execute-tool scope to new namespace.
src/microsoft/opentelemetry/a365/core/exporters/init.py Adds exporters package init.
src/microsoft/opentelemetry/a365/core/exporters/agent365_exporter.py Updates imports to new exporter utils path.
src/microsoft/opentelemetry/a365/core/exporters/agent365_exporter_options.py Adds/moves exporter options under new namespace.
src/microsoft/opentelemetry/a365/core/exporters/enriched_span.py Adds/moves enriched ReadableSpan wrapper.
src/microsoft/opentelemetry/a365/core/exporters/enriching_span_processor.py Updates imports to new constants/enriched span path.
src/microsoft/opentelemetry/a365/core/exporters/span_processor.py Updates imports to new constants path.
src/microsoft/opentelemetry/a365/core/exporters/spectra_exporter_options.py Adds Spectra exporter options class.
src/microsoft/opentelemetry/a365/core/exporters/utils.py Updates imports and internal importer paths within factory helpers.
src/microsoft/opentelemetry/a365/core/inference_call_details.py Updates imports to new inference operation/service endpoint paths.
src/microsoft/opentelemetry/a365/core/inference_operation_type.py Adds/moves inference operation type enum.
src/microsoft/opentelemetry/a365/core/inference_scope.py Updates imports to new core namespace.
src/microsoft/opentelemetry/a365/core/invoke_agent_details.py Updates imports to new service endpoint path.
src/microsoft/opentelemetry/a365/core/invoke_agent_scope.py Updates imports to new core namespace.
src/microsoft/opentelemetry/a365/core/message_utils.py Updates imports to new messages model path.
src/microsoft/opentelemetry/a365/core/middleware/init.py Updates middleware exports to new namespace.
src/microsoft/opentelemetry/a365/core/middleware/baggage_builder.py Updates imports to new constants/utils path.
src/microsoft/opentelemetry/a365/core/models/init.py Adds models package init.
src/microsoft/opentelemetry/a365/core/models/agent_type.py Adds/moves agent type enum.
src/microsoft/opentelemetry/a365/core/models/caller_details.py Updates imports/type-checking references to new model paths.
src/microsoft/opentelemetry/a365/core/models/messages.py Adds/moves OTel GenAI message schema types.
src/microsoft/opentelemetry/a365/core/models/operation_source.py Adds/moves operation source enum.
src/microsoft/opentelemetry/a365/core/models/response.py Updates imports to new messages model path.
src/microsoft/opentelemetry/a365/core/models/service_endpoint.py Adds/moves service endpoint model.
src/microsoft/opentelemetry/a365/core/models/user_details.py Adds/moves user details model.
src/microsoft/opentelemetry/a365/core/opentelemetry_scope.py Updates imports/type-checking references to new core namespace.
src/microsoft/opentelemetry/a365/core/request.py Updates imports to new channel/messages model paths.
src/microsoft/opentelemetry/a365/core/span_details.py Adds/moves span details model.
src/microsoft/opentelemetry/a365/core/spans_scopes/init.py Adds spans_scopes package init.
src/microsoft/opentelemetry/a365/core/spans_scopes/output_scope.py Updates imports to new core namespace.
src/microsoft/opentelemetry/a365/core/tool_call_details.py Updates imports to new service endpoint model path.
src/microsoft/opentelemetry/a365/core/tool_type.py Adds/moves tool type enum.
src/microsoft/opentelemetry/a365/core/trace_processor/init.py Updates trace processor export path.
src/microsoft/opentelemetry/a365/core/trace_processor/span_processor.py Updates imports to new constants/util paths.
src/microsoft/opentelemetry/a365/core/trace_processor/util.py Updates constants import and inline key comments to new namespace.
src/microsoft/opentelemetry/a365/core/utils.py Updates constants import to new namespace.
src/microsoft/opentelemetry/a365/hosting/init.py Updates hosting exports to new namespace.
src/microsoft/opentelemetry/a365/hosting/middleware/init.py Updates middleware exports to new namespace.
src/microsoft/opentelemetry/a365/hosting/middleware/baggage_middleware.py Updates imports to new middleware/scope helper paths.
src/microsoft/opentelemetry/a365/hosting/middleware/observability_hosting_manager.py Updates imports to new hosting middleware paths.
src/microsoft/opentelemetry/a365/hosting/middleware/output_logging_middleware.py Updates imports to new core/constants paths.
src/microsoft/opentelemetry/a365/hosting/scope_helpers/init.py Adds scope_helpers package init.
src/microsoft/opentelemetry/a365/hosting/scope_helpers/populate_baggage.py Updates imports to new baggage builder/scope helper utils paths.
src/microsoft/opentelemetry/a365/hosting/scope_helpers/populate_invoke_agent_scope.py Updates imports to new InvokeAgentScope/utils paths.
src/microsoft/opentelemetry/a365/hosting/scope_helpers/utils.py Updates constants import path to new a365 namespace.
src/microsoft/opentelemetry/a365/hosting/token_cache_helpers/init.py Updates exports to new token cache helper path.
src/microsoft/opentelemetry/a365/hosting/token_cache_helpers/agent_token_cache.py Adds/moves token cache implementation under new namespace.
src/microsoft/opentelemetry/a365/runtime/init.py Adds runtime API exports under new namespace.
src/microsoft/opentelemetry/a365/runtime/environment_utils.py Adds/moves environment utility logic under new namespace.
src/microsoft/opentelemetry/a365/runtime/operation_error.py Adds/moves operation error wrapper under new namespace.
src/microsoft/opentelemetry/a365/runtime/operation_result.py Updates import to new runtime error path.
src/microsoft/opentelemetry/a365/runtime/power_platform_api_discovery.py Adds/moves Power Platform API discovery helper under new namespace.
src/microsoft/opentelemetry/a365/runtime/utility.py Adds/moves runtime Utility functions under new namespace.
src/microsoft/opentelemetry/a365/runtime/version_utils.py Adds deprecated version utilities under new namespace.
src/microsoft/agents/a365/observability/core/init.py Removes legacy microsoft.agents.a365.observability.core public API module.
src/microsoft/agents/a365/observability/runtime/init.py Removes legacy microsoft.agents.a365.observability.runtime public API module.
Comments suppressed due to low confidence (2)

src/microsoft/opentelemetry/a365/core/config.py:236

  • The docstring says the default tracer name is 'microsoft.opentelemetry.a365.core', but the code uses DEFAULT_LOGGER_NAME = name (so the actual default will be this module name). Please align the documentation with the implementation, or change DEFAULT_LOGGER_NAME to the intended stable tracer name to avoid emitting spans under an unexpected instrumentation scope.
    src/microsoft/opentelemetry/a365/constants.py:49
  • This PR changes the emitted telemetry attribute keys from "microsoft.a365." to "microsoft.opentelemetry.a365." (e.g., GEN_AI_AGENT_PLATFORM_ID_KEY). That’s a behavioral/contract change for downstream processors/dashboards and is not mentioned in the PR description (which focuses on Python package namespace moves). Please confirm this is intentional; if not, keep the attribute key strings stable and only move the Python import namespace, or add a compatibility strategy (emit both keys / alias constants).

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

@hectorhdzg
Hector Hernandez (hectorhdzg) merged commit d6c18c4 into main Apr 17, 2026
11 checks passed
@hectorhdzg
Hector Hernandez (hectorhdzg) deleted the hectorhdzg/move-a365-genai-to-otel-namespace branch April 17, 2026 21:42
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