Skip to content

Commit

Permalink
Definition of boolean environment variables on the SDK (#2755)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobat authored Sep 22, 2022
1 parent 7a47bf9 commit 27aec90
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ release.

## Unreleased

- Add the definition of a Boolean environment variable
([#2755](/~https://github.com/open-telemetry/opentelemetry-specification/pull/2755)).

### Context

### Traces
Expand Down
9 changes: 9 additions & 0 deletions specification/sdk-environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ The SDK MUST interpret an empty value of an environment variable the same way as

**Status**: [Stable](document-status.md)

### Boolean value

Any value that represents a Boolean MUST be set to true only by the case-insensitive string `"true"`, meaning `"True"` or `"TRUE"` are also accepted, as true.
An SDK MUST NOT extend this definition and define additional values that are interpreted as true.
Any value not explicitly defined here as a true value, including unset and empty values, MUST be interpreted as false.
If any value other than a true value, case-insensitive string `"false"`, empty, or unset is used, a warning SHOULD be logged to inform users about the fallback to false being applied.
All Boolean environment variables SHOULD be named and defined such that false is the expected safe default behavior.
Renaming or changing the default value MUST NOT happen without a major version upgrade.

### Numeric value

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.
Expand Down

0 comments on commit 27aec90

Please sign in to comment.