opentelemetry-specification icon indicating copy to clipboard operation
opentelemetry-specification copied to clipboard

Support :? shell syntax for variable substitution

Open yurishkuro opened this issue 1 year ago • 2 comments

What are you trying to achieve?

Config WG merged a proposal (#3744, #3974, #3948) to support env var expansion syntax with defaults, using the traditional shell syntax VARNAME:-default. But shell syntax also commonly includes VARNAME:?error message syntax for undefined variables which was omitted. This omission is an unexpected behavior to users who are used to shell syntax.

Additional context.

  • https://github.com/open-telemetry/opentelemetry-specification/pull/4128#discussion_r1722198163
  • https://github.com/open-telemetry/opentelemetry-collector/pull/10907/files#r1722093779

yurishkuro avatar Aug 19 '24 19:08 yurishkuro

Agree that the behavior is unexpected.

Clarification on the history: Env var substitution syntax was added in #3744, extended to support ${env:ENV_VAR} in #3974, extended to support default syntax ${ENVVAR:-defaultValue} in #3948.

jack-berg avatar Aug 19 '24 19:08 jack-berg

@jack-berg as you're part of the config SIG we (@jpkrohling and I) are assuming you're the sponsor. Thanks.

danielgblanco avatar Aug 26 '24 09:08 danielgblanco