Customer SDKStats: Preserve casing for metric names#44855
Merged
rads-1996 merged 4 commits intoAzure:mainfrom Jan 27, 2026
Merged
Customer SDKStats: Preserve casing for metric names#44855rads-1996 merged 4 commits intoAzure:mainfrom
rads-1996 merged 4 commits intoAzure:mainfrom
Conversation
Member
Author
lzchen
approved these changes
Jan 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where customer SDK stats metric names were not displaying with the correct casing in Azure Monitor. The issue occurred because OpenTelemetry normalizes metric names to lowercase, but there was no mapping to restore the proper Pascal case (e.g., "Item_Success_Count") when exporting to Azure Monitor.
Changes:
- Added a mapping dictionary to convert lowercase OpenTelemetry metric names to Pascal case display names for customer SDK stats
- Updated the CustomerSdkStatsMetricName enum values to use lowercase names (matching what OpenTelemetry produces) instead of Pascal case
- Applied the metric name mapping in the metrics exporter when processing customer SDK stats metrics
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_constants.py | Added metric name mapping dictionary and updated enum values to lowercase to match OpenTelemetry's normalization |
| sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/metrics/_exporter.py | Added import and logic to apply customer SDK stats metric name mapping when exporting metrics |
| sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md | Added bug fix entry documenting the casing preservation fix |
...itor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/export/metrics/_exporter.py
Show resolved
Hide resolved
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.



All SDK Contribution checklist:
General Guidelines and Best Practices