Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify how to deal with invalid numeric envvars #2963

Merged
Merged
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ release.
([2679](https://github.com/open-telemetry/opentelemetry-specification/pull/2679))
- Add the definition of a Boolean environment variable
([#2755](https://github.com/open-telemetry/opentelemetry-specification/pull/2755)).
- Specify handling of invalid numeric environment variables
([#2963](https://github.com/open-telemetry/opentelemetry-specification/pull/2963))
Oberon00 marked this conversation as resolved.
Show resolved Hide resolved

### Telemetry Schemas

Expand Down
11 changes: 11 additions & 0 deletions specification/sdk-environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ Renaming or changing the default value MUST NOT happen without a major version u

If an SDK chooses to support an integer-valued environment variable, it SHOULD support nonnegative values between 0 and 2³¹ − 1 (inclusive). Individual SDKs MAY choose to support a larger range of values.

For variables accepting an numeric value, if the user provides a value the SDK cannot parse,
or which is outside the valid range for the configuration item, the SDK SHOULD
generate a warning and gracefully ignore the setting, i.e., treat them as not set.
In particular, SDKs
SHOULD NOT assign a custom interpretation e.g. to negative values if a negative
value does not naturally apply to a configuration, but treat it like any other
Oberon00 marked this conversation as resolved.
Show resolved Hide resolved
invalid value.
Oberon00 marked this conversation as resolved.
Show resolved Hide resolved
(Note: This paragraph was added after stabilization and the requirements are
thus qualified as "SHOULD" to allow SDKs to avoid breaking changes. For new
implementations, these should be treated as MUST-requirements.)

### Enum value

For variables which accept a known value out of a set, i.e., an enum value, SDK implementations MAY support additional values not listed here.
Expand Down