[Observability] Scope and domain overrides#133
Conversation
There was a problem hiding this comment.
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
PowerPlatformApiDiscoveryandAgent365ExporterCoreto 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;
juliomenendez
left a comment
There was a problem hiding this comment.
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").
🤖 SDK Parity AutomationSummaryThis PR modifies the .NET/C# SDK. To maintain feature parity across all SDKs, New parity issues have been created:
What happens next?
Need to skip parity?If parity is not needed for a particular SDK, close the corresponding issue with the Automated by AI-First Polling Workflow |
🤖 SDK Parity AutomationSummaryThis 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?
Need to skip parity?If parity is not needed for a particular SDK, close the corresponding issue with the Automated by AI-First Polling Workflow |
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