What problem do you want to solve?
Context
Following the OpenTelemetry Stable by Default proposal, distributions are expected to only enable stable components by default. This prevents users from unknowingly relying on experimental features that might break or change behavior unexpectedly.
In OpenTelemetry Python, we currently have OTEL_PYTHON_DISABLED_INSTRUMENTATIONS to opt-out of specific instrumentations. However, we lack a clear, standard way to opt-in to unstable (beta/alpha) instrumentations once the "stable by default" policy is enforced.
Describe the solution you'd like
Proposed solution
This feature request proposes to introduce a new environment variable and declarative configuration option to allow users to selectively enable unstable instrumentations.
OTEL_PYTHON_ENALBED_UNSTABLE_INSTRUMENTATIONS
1. Fine-Grained Opt-In
Introduce OTEL_PYTHON_ENABLED_UNSTABLE_INSTRUMENTATIONS.
Type: Comma-separated list of strings (similar to OTEL_PYTHON_DISABLED_INSTRUMENTATIONS).
Behavior: Only the specified unstable instrumentations will be loaded in addition to all stable ones.
Example: OTEL_PYTHON_ENABLED_UNSTABLE_INSTRUMENTATIONS="requests,django"
2. Interaction with Disable List
If an instrumentation is present in both OTEL_PYTHON_ENABLED_UNSTABLE_INSTRUMENTATIONS and OTEL_PYTHON_DISABLED_INSTRUMENTATIONS, the disable list should take precedence. This ensures that users can easily disable a library even if it was enabled as unstable.
Describe alternatives you've considered
Alternative options
A. Coarse-Grained Opt-In (Boolean Flag)
Set the value of OTEL_PYTHON_ENABLED_UNSTABLE_INSTRUMENTATIONS (or a similar variable) to true/false.
Pros: Simple for users who want to test all available unstable instrumentations.
Cons: Violates the principle of least surprise and doesn't allow fine-grained control. If one unstable library is causing issues, the user has to disable all unstable libraries or use the disable list (which might get messy).
B. Minimum Stability Level Threshold
Instead of listing libraries, allow users to set a minimum stability level to load.
Variable: OTEL_PYTHON_MINIMUM_STABILITY_LEVEL
Values: stable (default), beta, alpha.
Behavior: If set to beta, both stable and beta libraries are loaded.
Note: This aligns with the suggestion in the stability proposal blog post to "select a desired minimum stability level".
Additional Context
Please let me know which option you prefer.
cc: @aabmass
Would you like to implement a fix?
None
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
What problem do you want to solve?
Context
Following the OpenTelemetry Stable by Default proposal, distributions are expected to only enable stable components by default. This prevents users from unknowingly relying on experimental features that might break or change behavior unexpectedly.
In OpenTelemetry Python, we currently have
OTEL_PYTHON_DISABLED_INSTRUMENTATIONSto opt-out of specific instrumentations. However, we lack a clear, standard way to opt-in to unstable (beta/alpha) instrumentations once the "stable by default" policy is enforced.Describe the solution you'd like
Proposed solution
This feature request proposes to introduce a new environment variable and declarative configuration option to allow users to selectively enable unstable instrumentations.
1. Fine-Grained Opt-In
Introduce
OTEL_PYTHON_ENABLED_UNSTABLE_INSTRUMENTATIONS.Type: Comma-separated list of strings (similar to
OTEL_PYTHON_DISABLED_INSTRUMENTATIONS).Behavior: Only the specified unstable instrumentations will be loaded in addition to all stable ones.
Example: OTEL_PYTHON_ENABLED_UNSTABLE_INSTRUMENTATIONS="requests,django"
2. Interaction with Disable List
If an instrumentation is present in both
OTEL_PYTHON_ENABLED_UNSTABLE_INSTRUMENTATIONSandOTEL_PYTHON_DISABLED_INSTRUMENTATIONS, the disable list should take precedence. This ensures that users can easily disable a library even if it was enabled as unstable.Describe alternatives you've considered
Alternative options
A. Coarse-Grained Opt-In (Boolean Flag)
Set the value of
OTEL_PYTHON_ENABLED_UNSTABLE_INSTRUMENTATIONS(or a similar variable) to true/false.Pros: Simple for users who want to test all available unstable instrumentations.
Cons: Violates the principle of least surprise and doesn't allow fine-grained control. If one unstable library is causing issues, the user has to disable all unstable libraries or use the disable list (which might get messy).
B. Minimum Stability Level Threshold
Instead of listing libraries, allow users to set a minimum stability level to load.
Variable:
OTEL_PYTHON_MINIMUM_STABILITY_LEVELValues: stable (default), beta, alpha.
Behavior: If set to beta, both stable and beta libraries are loaded.
Note: This aligns with the suggestion in the stability proposal blog post to "select a desired minimum stability level".
Additional Context
Please let me know which option you prefer.
cc: @aabmass
Would you like to implement a fix?
None
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it. Learn more here.