opentelemetry-specification
opentelemetry-specification copied to clipboard
[file configuration] Clarify what should happen for invalid environment variable substitution
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
FY @marcalff
For example,
${API_KEY}is a environment variable substitution, while${1API_KEY}and${API_$KEY}are just strings.
I agree.
Agree with the proposal. Let's open a PR and include an example as well.
@jack-berg we assumed that you are the sponsor for this (cc @jpkrohling @danielgblanco)
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.