Skip to content

Add A365 Configuration Layer: Implementation Task 1 - #8

Merged
Jackson Weber (JacksonWeber) merged 5 commits into
microsoft:mainfrom
JacksonWeber:a365-configuration-layer
Apr 8, 2026
Merged

Jackson Weber (JacksonWeber) merged 5 commits into
microsoft:mainfrom
JacksonWeber:a365-configuration-layer

Conversation

@JacksonWeber

@JacksonWeber Jackson Weber (JacksonWeber) commented Apr 8, 2026 •

Copy link
Copy Markdown
Contributor

This pull request introduces an implementation plan for migrating the A365 observability runtime into the Microsoft OpenTelemetry JavaScript distribution and adds the initial implementation of the A365 configuration layer. The changes establish a clear migration strategy, define the target module structure, and provide a robust configuration resolution mechanism for A365 integration.

Implementation Plan and Configuration Layer Migration:

Documentation and Planning

  • Added A365_IMPLEMENTATION_PLAN.md, which details the phased migration of A365 observability code from Agent365-nodejs into the OpenTelemetry distro. The document outlines the migration scope, target module structure, implementation tasks for each subsystem (configuration, exporter, processors, scopes, context propagation, GenAI instrumentations, hosting), and testing/validation requirements. It also specifies the public API surface and export strategy for A365 types.

Configuration Layer Implementation

  • Introduced A365Configuration.ts in src/_a365/configuration/, implementing the A365 configuration layer. This class resolves configuration by merging defaults, programmatic options, JSON config, and environment variables (with a clear precedence order). It supports all required A365 options, including enabling/disabling, cluster category, domain override, OAuth scopes, per-request export, baggage, and hosting options.
  • Defined environment variable names for A365 configuration following the MICROSOFT_OTEL_A365_* convention and mapped legacy A365 environment variables to the new naming scheme.
  • Added validation and warning logic to notify users if A365 options are set but A365 is not enabled, improving usability and reducing configuration errors.

These foundational changes set up the codebase for the subsequent migration of A365 observability components and ensure configuration consistency across all integration points.

Implement the A365 configuration surface as defined in the A365 implementation
plan. This is the foundation for migrating the A365 observability runtime into
the Microsoft OpenTelemetry distro.

New files:
- src/_a365/configuration/A365ConfigurationOptions.ts: Public-facing types
  (A365Options, ClusterCategory, instrumentation configs)
- src/_a365/configuration/A365Configuration.ts: Resolved config class merging
  defaults, programmatic options, and MICROSOFT_OTEL_A365_* env vars
- src/_a365/utils/utils.ts: Env var reading utility
- src/_a365/{index,configuration/index}.ts: Barrel exports
- test/internal/unit/a365/a365Configuration.test.ts: 28 unit tests
- A365_IMPLEMENTATION_PLAN.md: Detailed migration plan for A365 convergence

Modified files:
- src/distro/types.ts: Added a365?: A365Options to MicrosoftOpenTelemetryOptions
- src/distro/index.ts: Export A365Options type
- src/index.ts: Re-export A365Configuration class and all A365 types

Defaults verified against microsoft/Agent365-nodejs source:
- authScopes defaults to ['https://api.powerplatform.com/.default']
- clusterCategory supports all 12 ClusterCategory values from source
- enabled defaults to false (matching isObservabilityExporterEnabled)
- perRequestExport defaults to false (batch export)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move OpenAI Agents, LangChain, and Microsoft Agent Framework instrumentation
options from A365Options.instrumentations into the root-level
InstrumentationOptions interface in src/types.ts. This unifies all
instrumentation toggles at the distro level rather than scoping them
under A365.

- Added openaiAgents, langchain, microsoftAgentFramework to InstrumentationOptions
- Moved OpenAIAgentsInstrumentationConfig and LangChainInstrumentationConfig to src/types.ts
- Removed A365InstrumentationOptions and instrumentations from A365Options
- Updated barrel exports and tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Update A365Options to remove instrumentations (now in global InstrumentationOptions)
- Update ClusterCategory to match full source enum
- Remove logLevel and exporterOptions from A365Options
- Fix wiring references: a365.instrumentations.* -> instrumentationOptions.*
- Fix corrupted npm package names (@_openai -> @openai, @_langchain -> @langchain)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove microsoftAgentFramework from InstrumentationOptions and clean up
all references in A365_IMPLEMENTATION_PLAN.md. This instrumentation is
not needed now and can be added later if required.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Parse the a365 key from applicationinsights.json (or
APPLICATIONINSIGHTS_CONFIGURATION_CONTENT env var) and merge into
A365Configuration with correct precedence:
  defaults -> programmatic -> JSON config -> env vars

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JacksonWeber
Jackson Weber (JacksonWeber) merged commit 51a0073 into microsoft:main Apr 8, 2026
5 checks passed
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.

2 participants