Skip to content

feat: wire all configuration options into runtime behavior; unify GenAI instrumentation interfaces and expand A365 config support - #44

Merged
Hector Hernandez (hectorhdzg) merged 11 commits into
microsoft:mainfrom
hectorhdzg:docs/a365-readme-config-guidance
Apr 24, 2026
Merged

Hector Hernandez (hectorhdzg) merged 11 commits into
microsoft:mainfrom
hectorhdzg:docs/a365-readme-config-guidance

Conversation

@hectorhdzg

Copy link
Copy Markdown
Member
  • document console exporter enablement and behavior\n- clarify instrumentation enable/disable patterns\n- align OpenAI/LangChain instrumentation interfaces with InstrumentationConfig\n- refresh GenAI samples with explicit enabled flags

- document console exporter enablement and behavior\n- clarify instrumentation enable/disable patterns\n- align OpenAI/LangChain instrumentation interfaces with InstrumentationConfig\n- refresh GenAI samples with explicit enabled flags

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

Expands and clarifies A365 migration and configuration guidance across public docs and samples, including console exporter behavior and updated GenAI instrumentation configuration shapes.

Changes:

  • Update InstrumentationOptions types to align GenAI configs with InstrumentationConfig-style shapes (enabled, etc.).
  • Refresh OpenAI/LangChain samples and README examples to use explicit enabled: true flags.
  • Expand README + A365 migration guidance around console exporters and instrumentation enable/disable patterns.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/types.ts Adjusts public types for GenAI instrumentation configs and their documented shape.
samples/src/openaiInstrumentation.ts Updates sample config to use enabled: true for OpenAI Agents instrumentation options.
samples/src/langchainInstrumentation.ts Updates sample config to use enabled: true for LangChain instrumentation options.
README.md Adds/clarifies instrumentation enable/disable guidance and documents console exporter behavior.
MIGRATION_A365.md Expands A365 option coverage and migration guidance (env vars, console exporters, hosting utilities).
Comments suppressed due to low confidence (2)

samples/src/openaiInstrumentation.ts:29

  • This sample configures instrumentationOptions.openaiAgents.enabled, but useMicrosoftOpenTelemetry() currently does not act on instrumentationOptions.openaiAgents (the distro only creates HTTP/Azure SDK/DB/Azure Functions + log instrumentations). As a result, the comment "this call is automatically traced" is misleading—either add distro support to initialize the OpenAI Agents instrumentor when enabled, or update the sample to use the actual enablement API.
  useMicrosoftOpenTelemetry({
    azureMonitor: {
      azureMonitorExporterOptions: {
        connectionString:
          process.env.APPLICATIONINSIGHTS_CONNECTION_STRING || "<your connection string>",
      },
    },
    instrumentationOptions: {
      openaiAgents: {
        enabled: true,
        isContentRecordingEnabled: true,
      },
    },
  });

samples/src/langchainInstrumentation.ts:30

  • This sample configures instrumentationOptions.langchain.enabled, but useMicrosoftOpenTelemetry() currently does not act on instrumentationOptions.langchain, so the "automatically traced" behavior won’t occur. Either wire LangChain enablement into the distro when this flag is set, or update the sample to call the supported LangChain instrumentor API directly.
  useMicrosoftOpenTelemetry({
    azureMonitor: {
      azureMonitorExporterOptions: {
        connectionString:
          process.env.APPLICATIONINSIGHTS_CONNECTION_STRING || "<your connection string>",
      },
    },
    instrumentationOptions: {
      langchain: {
        enabled: true,
        isContentRecordingEnabled: true,
      },
    },
  });

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

Comment thread MIGRATION_A365.md Outdated
Comment thread src/types.ts
Comment thread src/types.ts
Comment thread README.md Outdated
Comment thread README.md Outdated
@hectorhdzg Hector Hernandez (hectorhdzg) changed the title docs: expand A365 migration and configuration guidance feat: wire all configuration options into runtime behavior; unify GenAI instrumentation interfaces and expand A365 config support Apr 23, 2026
…AI instrumentation interfaces and expand A365 config support

- Wire GenAI instrumentation configs (openaiAgents, langchain) into distro initialization with lifecycle cleanup
- Connect A365 configuration to runtime: pass authScopes to token resolver, auto-register hosting middleware
- Wire tracerName/tracerVersion into OpenAI tracer initialization
- Expand A365 migration guide and README with comprehensive configuration examples
- Unify GenAI instrumentation interfaces to extend InstrumentationConfig like other instrumentations
- Eliminate configuration no-ops by ensuring all options drive actual runtime behavior

Closes: microsoft#44
…racerName/tracerVersion

The local interface definition in openAIAgentsTraceInstrumentor.ts was
shadowing the actual type from src/types.ts which includes tracerName
and tracerVersion properties. This caused TypeScript compilation errors.

Import the type from src/types.ts and remove the incomplete local definition.
The import was leftover from removing the local interface definition.
OpenAIAgentsInstrumentationConfig is imported from src/types.js which
already extends InstrumentationConfig, so this import is unnecessary.
Comment thread samples/src/langchainInstrumentation.ts
* Remove JSON configuration support from distro

Stop reading applicationinsights.json and remove JsonConfig from shared and A365 configuration flows.\n\nUpdate tests to reflect programmatic/env-only precedence, remove obsolete JsonConfig tests/snippets, and document the breaking change in the changelog.

* Fix misleading config validation test assertion
@hectorhdzg
Hector Hernandez (hectorhdzg) merged commit b397b1c into microsoft:main Apr 24, 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.

3 participants