Skip to content

[Observability] Scope and domain overrides#133

Merged
threddy merged 10 commits intomainfrom
users/threddy/preprod
Dec 9, 2025
Merged

[Observability] Scope and domain overrides#133
threddy merged 10 commits intomainfrom
users/threddy/preprod

Conversation

@threddy
Copy link
Copy Markdown
Contributor

@threddy threddy commented Dec 9, 2025

Why?
To enable 1P testing in pre-prod

What?
Enable overrides for scope and domain via environment variables "A365_OBSERVABILITY_DOMAIN_OVERRIDE" and "A365_OBSERVABILITY_SCOPE_OVERRIDE".


This PR introduces configuration-based overrides for the observability domain and authentication scope to enable testing against pre-production environments. The changes add two new configuration keys (A365_OBSERVABILITY_DOMAIN_OVERRIDE and A365_OBSERVABILITY_SCOPES_OVERRIDE) that allow runtime customization of Power Platform API endpoints and authentication scopes without code changes.

Key Changes
Added EnvironmentUtils.Initialize() method to cache scope override from configuration
Extended PowerPlatformApiDiscovery and Agent365ExporterCore to accept optional domain overrides
Created comprehensive test coverage for both override mechanisms

Copilot AI review requested due to automatic review settings December 9, 2025 17:39
@threddy threddy requested a review from a team as a code owner December 9, 2025 17:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 introduces configuration-based overrides for the observability domain and authentication scope to enable testing against pre-production environments. The changes add two new configuration keys (A365_OBSERVABILITY_DOMAIN_OVERRIDE and A365_OBSERVABILITY_SCOPES_OVERRIDE) that allow runtime customization of Power Platform API endpoints and authentication scopes without code changes.

Key Changes

  • Added EnvironmentUtils.Initialize() method to cache scope override from configuration
  • Extended PowerPlatformApiDiscovery and Agent365ExporterCore to accept optional domain overrides
  • Created comprehensive test coverage for both override mechanisms

Reviewed changes

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

Show a summary per file
File Description
src/Observability/Runtime/Common/EnvironmentUtils.cs Adds initialization method and static caching for scope override configuration
src/Observability/Runtime/Common/PowerPlatformApiDiscovery.cs Adds domain override parameter and logic to use custom domains when specified
src/Observability/Runtime/Tracing/Exporters/Agent365ExporterCore.cs Adds domain override field and passes it to PowerPlatformApiDiscovery
src/Observability/Runtime/Tracing/Exporters/ObservabilityTracerProviderBuilderExtensions.cs Retrieves domain override from configuration and passes to Agent365ExporterCore
src/Observability/Runtime/Builder.cs Calls EnvironmentUtils.Initialize() to cache configuration values at startup
src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/Common/EnvironmentUtilsTests.cs New test file validating scope override functionality and initialization behavior
src/Tests/Microsoft.Agents.A365.Observability.Runtime.Tests/Common/PowerPlatformApiDiscoveryTest.cs Adds test verifying domain override affects endpoint generation and hex suffix length
Comments suppressed due to low confidence (1)

src/Observability/Runtime/Tracing/Exporters/Agent365ExporterCore.cs:31

  • Field '_domainOverride' can be 'readonly'.
        private string? _domainOverride;

Comment thread src/Observability/Runtime/Common/EnvironmentUtils.cs Outdated
Comment thread src/Observability/Runtime/Builder.cs Outdated
Comment thread src/Observability/Runtime/Common/PowerPlatformApiDiscovery.cs Outdated
Comment thread src/Observability/Runtime/Common/EnvironmentUtils.cs Outdated
Comment thread src/Observability/Runtime/Common/EnvironmentUtils.cs Outdated
Copilot AI review requested due to automatic review settings December 9, 2025 18:05
Copy link
Copy Markdown
Contributor

@juliomenendez juliomenendez left a comment

Choose a reason for hiding this comment

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

As this is not a feature that's going to be widely used, let's use the environments instead of a configuration. I don't want it to make it easy to use. Let's use Environment.GetEnvironmentVariable("XXX").

Comment thread src/Observability/Runtime/Common/EnvironmentUtils.cs Outdated
Comment thread src/Observability/Runtime/Common/PowerPlatformApiDiscovery.cs
Comment thread src/Observability/Runtime/Tracing/Exporters/Agent365ExporterCore.cs
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread src/Observability/Runtime/Common/EnvironmentUtils.cs Outdated
Comment thread src/Observability/Runtime/Tracing/Exporters/Agent365ExporterCore.cs Outdated
Comment thread src/Observability/Runtime/Tracing/Exporters/Agent365ExporterCore.cs Outdated
@sergioescalera
Copy link
Copy Markdown

🤖 SDK Parity Automation

Summary

This PR modifies the .NET/C# SDK. To maintain feature parity across all SDKs, New parity issues have been created:

What happens next?

  1. Parity issues ready: GitHub Copilot agent (copilot-swe-agent) is assigned to these issues
  2. 🤖 Copilot will work on them: The agent will analyze your changes and generate corresponding PRs for each target SDK
  3. 👀 Review required: Once Copilot creates the PRs, they will need human review before merging

Need to skip parity?

If parity is not needed for a particular SDK, close the corresponding issue with the wontfix label.


Automated by AI-First Polling Workflow

@sergioescalera
Copy link
Copy Markdown

🤖 SDK Parity Automation

Summary

This PR modifies the .NET/C# SDK. To maintain feature parity across all SDKs, New parity issues have been created, and existing open issues were found:

What happens next?

  1. Parity issues ready: GitHub Copilot agent (copilot-swe-agent) is assigned to these issues
  2. 🤖 Copilot will work on them: The agent will analyze your changes and generate corresponding PRs for each target SDK
  3. 👀 Review required: Once Copilot creates the PRs, they will need human review before merging

Need to skip parity?

If parity is not needed for a particular SDK, close the corresponding issue with the wontfix label.


Automated by AI-First Polling Workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codegen-experiment AI First experimentation tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants