-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[AzureMonitorExporter] Add Performance Counter Support #52705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rajkumar-rangaraj
merged 11 commits into
Azure:main
from
rajkumar-rangaraj:rajrang/perfCounter
Oct 3, 2025
Merged
[AzureMonitorExporter] Add Performance Counter Support #52705
rajkumar-rangaraj
merged 11 commits into
Azure:main
from
rajkumar-rangaraj:rajrang/perfCounter
Oct 3, 2025
Conversation
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
Contributor
There was a problem hiding this 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 adds Performance Counter support to the Azure Monitor OpenTelemetry Exporter, enabling collection of system performance metrics alongside the existing application metrics.
- Introduces performance counter metrics collection including CPU usage, memory, request rate, and exception rate
- Refactors the StandardMetricsExtractionProcessor to support multiple meters for different metric types
- Adds comprehensive test coverage for the new performance counter functionality
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| StandardMetricTests.cs | Updates test methods to handle multiple metric telemetry items and adds comprehensive performance counter validation test |
| StandardMetricsExtractionProcessor.cs | Implements performance counter metrics collection with CPU calculation logic and memory monitoring |
| PerfCounterConstants.cs | Defines constants for performance counter metric names and their Azure Monitor mappings |
| AzureMonitorExporterEventSource.cs | Adds event logging for performance counter collection failures and diagnostic information |
...tor/Azure.Monitor.OpenTelemetry.Exporter/src/Internals/StandardMetricsExtractionProcessor.cs
Outdated
Show resolved
Hide resolved
...tor/Azure.Monitor.OpenTelemetry.Exporter/src/Internals/StandardMetricsExtractionProcessor.cs
Outdated
Show resolved
Hide resolved
...tor/Azure.Monitor.OpenTelemetry.Exporter/src/Internals/StandardMetricsExtractionProcessor.cs
Outdated
Show resolved
Hide resolved
...tor/Azure.Monitor.OpenTelemetry.Exporter/src/Internals/StandardMetricsExtractionProcessor.cs
Outdated
Show resolved
Hide resolved
...enTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/StandardMetricTests.cs
Outdated
Show resolved
Hide resolved
harsimar
reviewed
Sep 26, 2025
...tor/Azure.Monitor.OpenTelemetry.Exporter/src/Internals/StandardMetricsExtractionProcessor.cs
Outdated
Show resolved
Hide resolved
harsimar
reviewed
Sep 26, 2025
...tor/Azure.Monitor.OpenTelemetry.Exporter/src/Internals/StandardMetricsExtractionProcessor.cs
Outdated
Show resolved
Hide resolved
harsimar
reviewed
Sep 26, 2025
...enTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/StandardMetricTests.cs
Show resolved
Hide resolved
...tor/Azure.Monitor.OpenTelemetry.Exporter/src/Internals/StandardMetricsExtractionProcessor.cs
Show resolved
Hide resolved
harsimar
approved these changes
Oct 2, 2025
harsimar
approved these changes
Oct 3, 2025
This was referenced Oct 24, 2025
Bump Azure.Extensions.AspNetCore.Configuration.Secrets from 1.3.1 to 1.4.0
debug-expert/eShopOnWeb#1
Open
This was referenced Nov 2, 2025
Open
This was referenced Nov 17, 2025
Closed
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.
Thank you, @harsimar. Your earlier draft #52679 was instrumental in speeding up the process and adding this feature.
Application Insights Payload
{"name":"Metric","time":"2025-09-18T16:57:52.2217645Z","iKey":"key","tags":{"ai.cloud.role":"unknown_service:Azure.Monitor.OpenTelemetry.AspNetCore.Demo","ai.cloud.roleInstance":"roleinstance","ai.application.ver":null,"ai.internal.sdkVersion":"dotnet9.0.9:otel1.12.0:ext1.5.0-alpha.20250918-d"},"data":{"baseType":"MetricData","baseData":{"metrics":[{"name":"\\.NET CLR Exceptions(??APP_CLR_PROC??)\\# of Exceps Thrown / sec","value":12}],"ver":2}}} {"name":"Metric","time":"2025-09-18T16:57:52.2219188Z","iKey":"key","tags":{"ai.cloud.role":"unknown_service:Azure.Monitor.OpenTelemetry.AspNetCore.Demo","ai.cloud.roleInstance":"roleinstance","ai.application.ver":null,"ai.internal.sdkVersion":"dotnet9.0.9:otel1.12.0:ext1.5.0-alpha.20250918-d"},"data":{"baseType":"MetricData","baseData":{"metrics":[{"name":"\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec","value":9}],"ver":2}}} {"name":"Metric","time":"2025-09-18T16:57:52.2219863Z","iKey":"key","tags":{"ai.cloud.role":"unknown_service:Azure.Monitor.OpenTelemetry.AspNetCore.Demo","ai.cloud.roleInstance":"roleinstance","ai.application.ver":null,"ai.internal.sdkVersion":"dotnet9.0.9:otel1.12.0:ext1.5.0-alpha.20250918-d"},"data":{"baseType":"MetricData","baseData":{"metrics":[{"name":"\\Process(??APP_WIN32_PROC??)\\Private Bytes","value":48500736}],"ver":2}}} {"name":"Metric","time":"2025-09-18T16:57:52.2221929Z","iKey":"key","tags":{"ai.cloud.role":"unknown_service:Azure.Monitor.OpenTelemetry.AspNetCore.Demo","ai.cloud.roleInstance":"roleinstance","ai.application.ver":null,"ai.internal.sdkVersion":"dotnet9.0.9:otel1.12.0:ext1.5.0-alpha.20250918-d"},"data":{"baseType":"MetricData","baseData":{"metrics":[{"name":"\\Process(??APP_WIN32_PROC??)\\% Processor Time","value":4.3582136573120565}],"ver":2}}} {"name":"Metric","time":"2025-09-18T16:57:52.2222825Z","iKey":"key","tags":{"ai.cloud.role":"unknown_service:Azure.Monitor.OpenTelemetry.AspNetCore.Demo","ai.cloud.roleInstance":"roleinstance","ai.application.ver":null,"ai.internal.sdkVersion":"dotnet9.0.9:otel1.12.0:ext1.5.0-alpha.20250918-d"},"data":{"baseType":"MetricData","baseData":{"metrics":[{"name":"\\Process(??APP_WIN32_PROC??)\\% Processor Time Normalized","value":0.27238835358200353}],"ver":2}}}TODO in a follow up PRs
StandardMetricsExtractionProcessortoAzureMonitorMetricsExtractionProcessor