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

[file configuration] Clarify what should happen for invalid environment variable substitution

Open pellared opened this issue 1 year ago • 3 comments

What are you trying to achieve?

From: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/file-configuration.md#environment-variable-substitution

For example, ${API_KEY} is valid, while ${1API_KEY} and ${API_$KEY} are invalid.

I think saying "invalid" does not make it clear how it should it be interpreted.

Should the parsing fail? I do not think so,

Should it not make the substitution and leave it as a string? This is what I propose.

Maybe we could rephrase it to e.g.

For example, ${API_KEY} is a environment variable substitution, while ${1API_KEY} and ${API_$KEY} are just strings.

CC @jack-berg

pellared avatar Feb 29 '24 09:02 pellared

FY @marcalff

pellared avatar Feb 29 '24 09:02 pellared

For example, ${API_KEY} is a environment variable substitution, while ${1API_KEY} and ${API_$KEY} are just strings.

I agree.

marcalff avatar Feb 29 '24 09:02 marcalff

Agree with the proposal. Let's open a PR and include an example as well.

jack-berg avatar Mar 13 '24 16:03 jack-berg

@jack-berg we assumed that you are the sponsor for this (cc @jpkrohling @danielgblanco)

svrnm avatar Apr 22 '24 09:04 svrnm

I can sponsor, but not necessarily opening the PR myself.

@pellared, @marcalff please review #4002, which proposes solving this by erroring instead of keeping a string. The related issue #3981 makes a good case for why erroring is preferred.

jack-berg avatar Apr 22 '24 19:04 jack-berg