Substitute empty for unset config env vars without defaults#5408
Open
ocelotl wants to merge 1 commit into
Open
Substitute empty for unset config env vars without defaults#5408ocelotl wants to merge 1 commit into
ocelotl wants to merge 1 commit into
Conversation
ocelotl
marked this pull request as ready for review
July 13, 2026 02:04
ocelotl
force-pushed
the
issue_5405_unset_env_var_empty_value
branch
from
July 13, 2026 02:33
c108bb7 to
9697dea
Compare
MikeGoldsmith
requested changes
Jul 13, 2026
MikeGoldsmith
left a comment
Member
There was a problem hiding this comment.
Looks good. Left one comment regarding allowing empty substitute values which we'll need to resolve.
Declarative config environment variable substitution rejected any
${VAR} reference to an unset variable that had no default, raising a
ConfigurationError and preventing SDK initialization. The declarative
configuration spec requires an unset variable without a default to be
replaced with an empty value (which YAML then reads as null), matching
the Java and Node.js implementations and allowing config files to be
shared across languages.
Replace the raise with empty substitution. EnvSubstitutionError is kept
as public API for backward compatibility but is no longer raised.
Update tests accordingly.
Fixes open-telemetry#5405
ocelotl
force-pushed
the
issue_5405_unset_env_var_empty_value
branch
from
July 16, 2026 02:42
1aa11c5 to
0700cf7
Compare
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
Fixes #5405.
Declarative config environment variable substitution rejected any
${VAR}reference to an unset variable that had no default, raising aConfigurationErrorand preventing SDK initialization:The declarative configuration spec requires an unset variable without a default to be replaced with an empty value (which the YAML parser then interprets as null). This matches the Java and Node.js implementations and lets configuration files be shared across languages.
Changes
opentelemetry-configuration: an unset${VAR}with no default now substitutes an empty value instead of raising.EnvSubstitutionError(its only raise site is gone) from the module and thefilepackage's public exports.${ENV:-production}still applies its default.Type of change
How Has This Been Tested?
opentelemetry-configurationtest suite (363 passed, 5 subtests).ruff checkandruff format --checkclean on the changed files.Does This PR Require a Contrib Repo Change?
Checklist: