Customer SDKStats: Rename metric names and set the environment variable on by default#44849
Merged
rads-1996 merged 5 commits intoAzure:mainfrom Jan 26, 2026
Merged
Conversation
Member
Author
ede138b to
c886a1f
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the customer SDK stats feature to use a new environment variable convention (default-on via a ..._DISABLED flag) and renames the emitted metric names to their final, non-preview forms.
Changes:
- Replace
APPLICATIONINSIGHTS_SDKSTATS_ENABLED_PREVIEWwithAPPLICATIONINSIGHTS_SDKSTATS_DISABLEDand changeis_customer_sdkstats_enabled()semantics so customer SDK stats are enabled by default unless explicitly disabled. - Rename
CustomerSdkStatsMetricNamevalues frompreview.item.*.counttoItem_*_Countstrings used when creating the observable gauges. - Update all affected tests (base exporter, customer sdkstats utilities/manager/core tests) and the CHANGELOG entry to match the new behavior and naming.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_base_exporter.py | Adjusts environment setup in base exporter tests to use APPLICATIONINSIGHTS_SDKSTATS_DISABLED and reflect the default-on behavior. |
| sdk/monitor/azure-monitor-opentelemetry-exporter/tests/test_base_customer_sdkstats.py | Switches customer SDK stats test setup/teardown to the new ..._DISABLED environment variable semantics. |
| sdk/monitor/azure-monitor-opentelemetry-exporter/tests/customer_sdk_stats/test_utlities.py | Updates imports, env var handling, and is_customer_sdkstats_enabled tests to align with the disabled-flag and default-enabled logic. |
| sdk/monitor/azure-monitor-opentelemetry-exporter/tests/customer_sdk_stats/test_manager.py | Uses the new ..._DISABLED flag in manager setup and disabled-path tests, ensuring manager status reflects the updated enable/disable semantics. |
| sdk/monitor/azure-monitor-opentelemetry-exporter/tests/customer_sdk_stats/test_customer_sdkstats.py | Updates core customer SDK stats tests to enable/disable via APPLICATIONINSIGHTS_SDKSTATS_DISABLED. |
| sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/statsbeat/customer/_utils.py | Changes is_customer_sdkstats_enabled() to read APPLICATIONINSIGHTS_SDKSTATS_DISABLED and default to enabled when unset. |
| sdk/monitor/azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_constants.py | Replaces the *_ENABLED_PREVIEW constant with *_DISABLED and updates CustomerSdkStatsMetricName values to new metric names. |
| sdk/monitor/azure-monitor-opentelemetry-exporter/CHANGELOG.md | Documents the metric name rename and default-on behavior for customer SDK stats in the unreleased 1.0.0b47 section. |
lzchen
approved these changes
Jan 26, 2026
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.



Description
Customer SDKStats: Rename metric names and set the environment variable on by default
All SDK Contribution checklist:
General Guidelines and Best Practices