Skip to content

feat: Add ability to selectively enable exporting of SDK internal metrics with the OTEL_PYTHON_SDK_INTERNAL_METRICS_ENABLED environment variable#5151

Open
herin049 wants to merge 7 commits intoopen-telemetry:mainfrom
herin049:feat/skd-metrics-opt-in
Open

feat: Add ability to selectively enable exporting of SDK internal metrics with the OTEL_PYTHON_SDK_INTERNAL_METRICS_ENABLED environment variable#5151
herin049 wants to merge 7 commits intoopen-telemetry:mainfrom
herin049:feat/skd-metrics-opt-in

Conversation

@herin049
Copy link
Copy Markdown
Contributor

@herin049 herin049 commented Apr 27, 2026

Description

Adds ability to selectively enable/disable exporting of SDK internal metric collection with the introduction of the OTEL_PYTHON_SDK_METRIC_ENABLED environment variable.

Motivation

While the "Stable by Default" OTEP has not been finalized yet, it is still preferrable to not emit unstable metric by default.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

uv run tox -e py314-test-opentelemetry-sdk

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@herin049 herin049 requested a review from a team as a code owner April 27, 2026 03:26
@herin049 herin049 moved this to Reviewed PRs that need fixes in Python PR digest Apr 27, 2026
@herin049 herin049 moved this from Reviewed PRs that need fixes to Ready for review in Python PR digest Apr 27, 2026
@herin049 herin049 added the Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary label Apr 27, 2026
Copy link
Copy Markdown
Member

@MikeGoldsmith MikeGoldsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks @herin049.

It would be good to replace existing env var parsing with the new parse_boolean_environment_variable helper you've added in a follow-up PR.

@github-project-automation github-project-automation Bot moved this from Ready for review to Approved PRs in Python PR digest Apr 27, 2026
Comment thread CHANGELOG.md Outdated
@herin049 herin049 changed the title feat: Add ability to selectively enable exporting of SDK internal metrics with the OTEL_PYTHON_SDK_METRIC_ENABLED environment variable feat: Add ability to selectively enable exporting of SDK internal metrics with the OTEL_PYTHON_SDK_INTERNAL_METRICS_ENABLED environment variable Apr 28, 2026
@herin049 herin049 requested a review from DylanRussell April 28, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary

Projects

Status: Approved PRs

Development

Successfully merging this pull request may close these issues.

3 participants