Skip to content

Commit a720f49

Browse files
Merge branch 'main' into event_space_namespace_update
2 parents af5bbf8 + 92360f1 commit a720f49

File tree

4 files changed

+29
-20
lines changed

4 files changed

+29
-20
lines changed

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,15 @@ release.
2525
- New exporter implementations do not need to support
2626
`OTEL_EXPORTER_OTLP_SPAN_INSECURE` and `OTEL_EXPORTER_OTLP_METRIC_INSECURE`.
2727
([#3719](https://github.com/open-telemetry/opentelemetry-specification/pull/3719))
28-
- Clarify that the configuration options MAY be implemented by the exporter,
29-
the SDK, or a separate component (e.g. environment-based autoconfiguration component).
30-
([#3719](https://github.com/open-telemetry/opentelemetry-specification/pull/3719))
3128

3229
### Compatibility
3330

3431
### SDK Configuration
3532

3633
- Define file configuration parse and create operations.
3734
([#3437](https://github.com/open-telemetry/opentelemetry-specification/pull/3437))
35+
- Add environment variable implementation guidelines.
36+
([#3738](https://github.com/open-telemetry/opentelemetry-specification/pull/3738))
3837

3938
### Common
4039

spec-compliance-matrix.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ formats is required. Implementing more than one format is optional.
2020
| Create TracerProvider | | + | + | + | + | + | + | + | + | + | + | + |
2121
| Get a Tracer | | + | + | + | + | + | + | + | + | + | + | + |
2222
| Get a Tracer with schema_url | | + | + | | + | | | + | | + | | |
23-
| Get a Tracer with scope attributes | | | | | | | | + | | | | |
23+
| Get a Tracer with scope attributes | | | | | | | | + | | + | | |
2424
| Associate Tracer with InstrumentationScope | | | | | + | | | + | | | | |
2525
| Safe for concurrent calls | | + | + | + | + | + | + | + | + | + | + | + |
2626
| Shutdown (SDK only required) | | + | + | + | + | + | + | + | + | + | + | + |
@@ -67,7 +67,7 @@ formats is required. Implementing more than one format is optional.
6767
| Unicode support for keys and string values | | + | + | + | + | + | + | + | + | + | + | + |
6868
| [Span linking](specification/trace/api.md#specifying-links) | Optional | Go | Java | JS | Python | Ruby | Erlang | PHP | Rust | C++ | .NET | Swift |
6969
| Links can be recorded on span creation | | + | + | | + | + | + | + | + | + | + | |
70-
| Links can be recorded after span creation | | | | | | | | | | | | |
70+
| Links can be recorded after span creation | | | | | | | | | | + | | |
7171
| Links order is preserved | | + | + | | + | + | + | + | + | + | + | |
7272
| [Span events](specification/trace/api.md#add-events) | | | | | | | | | | | | |
7373
| AddEvent | | + | + | + | + | + | + | + | + | + | + | + |
@@ -102,7 +102,7 @@ formats is required. Implementing more than one format is optional.
102102
| It is possible to create any number of `MeterProvider`s. | X | + | + | + | + | | | + | + | + | + | |
103103
| `MeterProvider` provides a way to get a `Meter`. | | + | + | + | + | | | + | + | + | - | |
104104
| `get_meter` accepts name, `version` and `schema_url`. | | + | + | + | + | | | + | + | + | - | |
105-
| `get_meter` accepts `attributes`. | | | | | | | | + | + | | | |
105+
| `get_meter` accepts `attributes`. | | | | | | | | + | + | + | | |
106106
| When an invalid `name` is specified a working `Meter` implementation is returned as a fallback. | | + | + | + | + | | | | + | + | - | |
107107
| The fallback `Meter` `name` property keeps its original invalid value. | X | - | - | + | + | | | | + | - | - | |
108108
| Associate `Meter` with `InstrumentationScope`. | | | + | + | + | | | | + | + | | |

specification/configuration/sdk-environment-variables.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,18 @@ aliases:
1010

1111
**Status**: [Mixed](../document-status.md)
1212

13-
The goal of this specification is to unify the environment variable names between different OpenTelemetry SDK implementations. SDKs MAY choose to allow configuration via the environment variables in this specification, but are not required to. If they do, they SHOULD use the names listed in this document.
13+
The goal of this specification is to unify the environment variable names between different OpenTelemetry implementations.
14+
15+
Implementations MAY choose to allow configuration via the environment variables in this specification, but are not required to.
16+
If they do, they SHOULD use the names listed in this document.
17+
18+
## Implementation guidelines
19+
20+
**Status**: [Stable](../document-status.md)
21+
22+
Environment variables MAY be handled (implemented) directly by a component, in the SDK, or in a separate component (e.g. environment-based autoconfiguration component).
23+
24+
The environment-based configuration MUST have a direct code configuration equivalent.
1425

1526
## Parsing empty value
1627

@@ -25,25 +36,25 @@ The SDK MUST interpret an empty value of an environment variable the same way as
2536
### Boolean value
2637

2738
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.
28-
An SDK MUST NOT extend this definition and define additional values that are interpreted as true.
39+
An implementation MUST NOT extend this definition and define additional values that are interpreted as true.
2940
Any value not explicitly defined here as a true value, including unset and empty values, MUST be interpreted as false.
3041
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.
3142
All Boolean environment variables SHOULD be named and defined such that false is the expected safe default behavior.
3243
Renaming or changing the default value MUST NOT happen without a major version upgrade.
3344

3445
### Numeric value
3546

36-
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.
47+
If an implementation 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.
3748

3849
> The following paragraph was added after stabilization and the requirements are
39-
thus qualified as "SHOULD" to allow SDKs to avoid breaking changes.
50+
thus qualified as "SHOULD" to allow implementations to avoid breaking changes.
4051
For new
4152
implementations, these should be treated as MUST requirements.
4253

43-
For variables accepting a numeric value, if the user provides a value the SDK cannot parse,
44-
or which is outside the valid range for the configuration item, the SDK SHOULD
54+
For variables accepting a numeric value, if the user provides a value the implementation cannot parse,
55+
or which is outside the valid range for the configuration item, the implementation SHOULD
4556
generate a warning and gracefully ignore the setting, i.e., treat them as not set.
46-
In particular, SDKs
57+
In particular, implementations
4758
SHOULD NOT assign a custom interpretation e.g. to negative values if a negative
4859
value does not naturally apply to a configuration and does not have an explicitly specified meaning, but treat it like any other
4960
invalid value.
@@ -57,15 +68,15 @@ because it might reset a value set from other configuration sources with the def
5768

5869
### Enum value
5970

60-
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.
61-
For variables accepting an enum value, if the user provides a value the SDK does not recognize, the SDK MUST generate a warning and gracefully ignore the setting.
71+
For variables which accept a known value out of a set, i.e., an enum value, implementations MAY support additional values not listed here.
72+
For variables accepting an enum value, if the user provides a value the implementation does not recognize, the implementation MUST generate a warning and gracefully ignore the setting.
6273

6374
If a null object (empty, no-op) value is acceptable, then the enum value representing it MUST be `"none"`.
6475

6576
### Duration
6677

6778
Any value that represents a duration, for example a timeout, MUST be an integer representing a number of
68-
milliseconds. The value is non-negative - if a negative value is provided, the SDK MUST generate a warning,
79+
milliseconds. The value is non-negative - if a negative value is provided, the implementation MUST generate a warning,
6980
gracefully ignore the setting and use the default value if it is defined.
7081

7182
For example, the value `12000` indicates 12000 milliseconds, i.e., 12 seconds.
@@ -82,7 +93,7 @@ For example, the value `12000` indicates 12000 milliseconds, i.e., 12 seconds.
8293
| OTEL_LOG_LEVEL | Log level used by the SDK logger | "info" | |
8394
| OTEL_PROPAGATORS | Propagators to be used as a comma-separated list | "tracecontext,baggage" | Values MUST be deduplicated in order to register a `Propagator` only once. |
8495
| OTEL_TRACES_SAMPLER | Sampler to be used for traces | "parentbased_always_on" | See [Sampling](../trace/sdk.md#sampling) |
85-
| OTEL_TRACES_SAMPLER_ARG | String value to be used as the sampler argument | | The specified value will only be used if OTEL_TRACES_SAMPLER is set. Each Sampler type defines its own expected input, if any. Invalid or unrecognized input MUST be logged and MUST be otherwise ignored, i.e. the SDK MUST behave as if OTEL_TRACES_SAMPLER_ARG is not set. |
96+
| OTEL_TRACES_SAMPLER_ARG | String value to be used as the sampler argument | | The specified value will only be used if OTEL_TRACES_SAMPLER is set. Each Sampler type defines its own expected input, if any. Invalid or unrecognized input MUST be logged and MUST be otherwise ignored, i.e. the implementation MUST behave as if OTEL_TRACES_SAMPLER_ARG is not set. |
8697

8798
Known values for `OTEL_PROPAGATORS` are:
8899

@@ -140,7 +151,7 @@ Depending on the value of `OTEL_TRACES_SAMPLER`, `OTEL_TRACES_SAMPLER_ARG` may b
140151

141152
## Attribute Limits
142153

143-
SDKs SHOULD only offer environment variables for the types of attributes, for
154+
Implementations SHOULD only offer environment variables for the types of attributes, for
144155
which that SDK implements truncation mechanism.
145156

146157
See the SDK [Attribute Limits](../common/README.md#attribute-limits) section for the definition of the limits.
@@ -219,7 +230,7 @@ We define environment variables for setting one or more exporters per signal.
219230
| OTEL_METRICS_EXPORTER | Metrics exporter to be used | "otlp" |
220231
| OTEL_LOGS_EXPORTER | Logs exporter to be used | "otlp" |
221232

222-
The SDK MAY accept a comma-separated list to enable setting multiple exporters.
233+
The implementation MAY accept a comma-separated list to enable setting multiple exporters.
223234

224235
Known values for `OTEL_TRACES_EXPORTER` are:
225236

specification/protocol/exporter.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ This document specifies the configuration options available to the OpenTelemetry
1111
## Configuration Options
1212

1313
The following configuration options MUST be available to configure the OTLP exporter.
14-
The configuration options MAY be implemented directly in the OTLP exporter, in the SDK, or in a separate component (e.g. environment-based autoconfiguration component).
1514
Each configuration option MUST be overridable by a signal specific option.
1615

1716
- **Endpoint (OTLP/HTTP)**: Target URL to which the exporter is going to send spans or metrics. The endpoint MUST be a valid URL with scheme (http or https) and host, MAY contain a port, SHOULD contain a path and MUST NOT contain other parts (such as query string or fragment). A scheme of https indicates a secure connection. When using `OTEL_EXPORTER_OTLP_ENDPOINT`, exporters MUST construct per-signal URLs as [described below](#endpoint-urls-for-otlphttp). The per-signal endpoint configuration options take precedence and can be used to override this behavior (the URL is used as-is for them, without any modifications). See the [OTLP Specification][otlphttp-req] for more details.

0 commit comments

Comments
 (0)