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

Define OTEL_EXPERIMENTAL_CONFIG_FILE to ignore other env vars, add env var substitution default syntax #3948

Merged
merged 13 commits into from
Apr 5, 2024
Merged
63 changes: 32 additions & 31 deletions spec-compliance-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,37 +276,38 @@ Disclaimer: this list of features is still a work in progress, please refer to t

Note: Support for environment variables is optional.

| Feature | Go | Java | JS | Python | Ruby | Erlang | PHP | Rust | C++ | .NET | Swift |
|----------------------------------------------------------|-----|------|-----|-------------|------|--------|-----|------|-----|------|-------|
| OTEL_SDK_DISABLED | - | + | - | - | - | - | + | - | - | - | - |
| OTEL_RESOURCE_ATTRIBUTES | + | + | + | + | + | + | + | + | + | + | - |
| OTEL_SERVICE_NAME | + | + | + | + | + | + | + | | + | + | |
| OTEL_LOG_LEVEL | - | - | + | [-][py1059] | + | - | + | | - | - | - |
| OTEL_PROPAGATORS | - | + | | + | + | + | + | - | - | - | - |
| OTEL_BSP_* | + | + | + | + | + | + | + | + | - | + | - |
| OTEL_BLRP_* | | + | | | | | | + | | + | |
| OTEL_EXPORTER_OTLP_* | + | + | | + | + | + | + | + | + | + | - |
| OTEL_EXPORTER_ZIPKIN_* | - | + | | + | + | - | + | - | - | + | - |
| OTEL_TRACES_EXPORTER | - | + | + | + | + | + | + | - | - | - | |
| OTEL_METRICS_EXPORTER | - | + | | + | - | - | + | - | - | - | - |
| OTEL_LOGS_EXPORTER | - | + | | + | | | + | | | - | |
| OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT | + | + | + | + | + | + | + | + | - | + | |
| OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT | + | + | + | + | + | + | + | | | + | |
| OTEL_SPAN_EVENT_COUNT_LIMIT | + | + | + | + | + | + | + | + | - | + | |
| OTEL_SPAN_LINK_COUNT_LIMIT | + | + | + | + | + | + | + | + | - | + | |
| OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT | + | - | | + | + | + | + | | | + | |
| OTEL_LINK_ATTRIBUTE_COUNT_LIMIT | + | - | | + | + | + | + | | | + | |
| OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT | | | | | | | + | | | | |
| OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT | | | | | | | + | | | | |
| OTEL_TRACES_SAMPLER | + | + | + | + | + | + | + | - | - | - | |
| OTEL_TRACES_SAMPLER_ARG | + | + | + | + | + | + | + | - | - | - | |
| OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT | + | + | + | + | + | - | + | | | + | |
| OTEL_ATTRIBUTE_COUNT_LIMIT | + | + | + | + | + | - | + | | | + | |
| OTEL_METRIC_EXPORT_INTERVAL | - | + | | | | | + | | | + | |
| OTEL_METRIC_EXPORT_TIMEOUT | - | - | | | | | + | | | + | |
| OTEL_METRICS_EXEMPLAR_FILTER | - | + | | | | | + | | | - | |
| OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE | - | + | + | + | | | + | | | + | |
| OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION | | + | | | | | | | | | |
| Feature | Go | Java | JS | Python | Ruby | Erlang | PHP | Rust | C++ | .NET | Swift |
|----------------------------------------------------------|----|------|----|-------------|------|--------|-----|------|-----|------|-------|
| OTEL_SDK_DISABLED | - | + | - | - | - | - | + | - | - | - | - |
| OTEL_RESOURCE_ATTRIBUTES | + | + | + | + | + | + | + | + | + | + | - |
| OTEL_SERVICE_NAME | + | + | + | + | + | + | + | | + | + | |
| OTEL_LOG_LEVEL | - | - | + | [-][py1059] | + | - | + | | - | - | - |
| OTEL_PROPAGATORS | - | + | | + | + | + | + | - | - | - | - |
| OTEL_BSP_* | + | + | + | + | + | + | + | + | - | + | - |
| OTEL_BLRP_* | | + | | | | | | + | | + | |
| OTEL_EXPORTER_OTLP_* | + | + | | + | + | + | + | + | + | + | - |
| OTEL_EXPORTER_ZIPKIN_* | - | + | | + | + | - | + | - | - | + | - |
| OTEL_TRACES_EXPORTER | - | + | + | + | + | + | + | - | - | - | |
| OTEL_METRICS_EXPORTER | - | + | | + | - | - | + | - | - | - | - |
| OTEL_LOGS_EXPORTER | - | + | | + | | | + | | | - | |
| OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT | + | + | + | + | + | + | + | + | - | + | |
| OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT | + | + | + | + | + | + | + | | | + | |
| OTEL_SPAN_EVENT_COUNT_LIMIT | + | + | + | + | + | + | + | + | - | + | |
| OTEL_SPAN_LINK_COUNT_LIMIT | + | + | + | + | + | + | + | + | - | + | |
| OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT | + | - | | + | + | + | + | | | + | |
| OTEL_LINK_ATTRIBUTE_COUNT_LIMIT | + | - | | + | + | + | + | | | + | |
| OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT | | | | | | | + | | | | |
| OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT | | | | | | | + | | | | |
| OTEL_TRACES_SAMPLER | + | + | + | + | + | + | + | - | - | - | |
| OTEL_TRACES_SAMPLER_ARG | + | + | + | + | + | + | + | - | - | - | |
| OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT | + | + | + | + | + | - | + | | | + | |
| OTEL_ATTRIBUTE_COUNT_LIMIT | + | + | + | + | + | - | + | | | + | |
| OTEL_METRIC_EXPORT_INTERVAL | - | + | | | | | + | | | + | |
| OTEL_METRIC_EXPORT_TIMEOUT | - | - | | | | | + | | | + | |
| OTEL_METRICS_EXEMPLAR_FILTER | - | + | | | | | + | | | - | |
| OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE | - | + | + | + | | | + | | | + | |
| OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION | | + | | | | | | | | | |
| OTEL_EXPERIMENTAL_CONFIG_FILE | | | | | | | | | | | |

## File Configuration

Expand Down
11 changes: 8 additions & 3 deletions specification/configuration/file-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Configuration files support environment variables substitution for references
which match the following regular expression:

```regexp
\$\{(?<ENV_NAME>[a-zA-Z_][a-zA-Z0-9_]*)}
\$\{(?<ENV_NAME>[a-zA-Z_][a-zA-Z0-9_]*)(:-(?<DEFAULT_VALUE>[^\n]*))?}
```

The `ENV_NAME` MUST start with an alphabetic or `_` character, and is followed
Expand All @@ -84,8 +84,11 @@ invalid.
Environment variable substitution MUST only apply to scalar values. Mapping keys
are not candidates for substitution.

If a referenced environment variable is not defined, it MUST be replaced with an
empty value.
The `DEFAULT_VALUE` is an optional fallback value which is substituted
if `ENV_NAME` is null or undefined. `DEFAULT_VALUE` is consists of 0 or more non
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
jack-berg marked this conversation as resolved.
Show resolved Hide resolved
line break characters (i.e. any character except `\n`). If a referenced
environment variable is not defined and does not have a `DEFAULT_VALUE`, it MUST
be replaced with an empty value.

Node types MUST be interpreted after environment variable substitution takes
place. This ensures the environment string representation of boolean, integer,
Expand Down Expand Up @@ -114,6 +117,7 @@ bool_key: ${BOOl_VALUE} # Valid reference to BOOl_
int_key: ${INT_VALUE} # Valid reference to INT_VALUE
float_key: ${FLOAT_VALUE} # Valid reference to FLOAT_VALUE
combo_string_key: foo ${STRING_VALUE} ${FLOAT_VALUE} # Valid reference to STRING_VALUE and FLOAT_VALUE
string_key_with_default: ${UNDEFINED_KEY:-fallback} # UNDEFINED_KEY is not defined but a default value is included
undefined_key: ${UNDEFINED_KEY} # Invalid reference, UNDEFINED_KEY is not defined and is replaced with ""
${STRING_VALUE}: value # Invalid reference, substitution is not valid in mapping keys and reference is ignored
```
Expand All @@ -129,6 +133,7 @@ bool_key: true # Interpreted as type bool, tag URI
int_key: 1 # Interpreted as type int, tag URI tag:yaml.org,2002:int
float_key: 1.1 # Interpreted as type float, tag URI tag:yaml.org,2002:float
combo_string_key: foo value 1.1 # Interpreted as type string, tag URI tag:yaml.org,2002:str
string_key_with_default: fallback # Interpreted as type string, tag URI tag:yaml.org,2002:str
undefined_key: # Interpreted as type null, tag URI tag:yaml.org,2002:null
${STRING_VALUE}: value # Interpreted as type string, tag URI tag:yaml.org,2002:str
```
Expand Down
Loading
Loading