Skip to content

[Azure Monitor Exporter] Add custom resource support#53432

Merged
rajkumar-rangaraj merged 2 commits intoAzure:mainfrom
rajkumar-rangaraj:rajrang/customResourceSupport
Oct 23, 2025
Merged

[Azure Monitor Exporter] Add custom resource support#53432
rajkumar-rangaraj merged 2 commits intoAzure:mainfrom
rajkumar-rangaraj:rajrang/customResourceSupport

Conversation

@rajkumar-rangaraj
Copy link
Contributor

  • Add custom resource support
  • We have test coverage for this feature
  • Fixed flaky test - ValidatePerfCounterMetrics

Copilot AI review requested due to automatic review settings October 22, 2025 19:14
@github-actions github-actions bot added the Monitor - Exporter Monitor OpenTelemetry Exporter label Oct 22, 2025
Copy link
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 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

@rajkumar-rangaraj rajkumar-rangaraj merged commit d2ac528 into Azure:main Oct 23, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Exporter Monitor OpenTelemetry Exporter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants