[Azure Monitor Exporter] Add custom resource support#53432
Merged
rajkumar-rangaraj merged 2 commits intoAzure:mainfrom Oct 23, 2025
Merged
[Azure Monitor Exporter] Add custom resource support#53432rajkumar-rangaraj merged 2 commits intoAzure:mainfrom
rajkumar-rangaraj merged 2 commits intoAzure:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enables resource metrics export by default in the Azure Monitor OpenTelemetry Exporter by changing the behavior when the EXPORT_RESOURCE_METRIC environment variable is not set. Additionally, it addresses a flaky test in ValidatePerfCounterMetrics by implementing proper waiting logic for performance counter collection cycles.
Key Changes:
- Modified default behavior to export resource metrics when the environment variable is null or "true" (previously only "true")
- Fixed flaky test by adding SpinWait logic to properly wait for performance counter collection before assertions
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ResourceExtensions.cs | Changed condition to enable resource metric export by default (when env var is null) |
| ResourceExtensionsTests.cs | Updated test assertions to account for new default behavior where null env var enables resource metrics |
| StandardMetricTests.cs | Added SpinWait logic to properly wait for performance counter collection cycle completion |
| CHANGELOG.md | Added entry documenting the new default behavior for resource metrics export |
...enTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/StandardMetricTests.cs
Show resolved
Hide resolved
harsimar
approved these changes
Oct 22, 2025
This was referenced Dec 8, 2025
This was referenced Dec 27, 2025
This was referenced Jan 7, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ValidatePerfCounterMetrics