diff --git a/CHANGELOG.md b/CHANGELOG.md index cafe951dd70..eaf0608f95d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,9 @@ release. ### Resource +- Refine the handling of OTEL_RESOURCE_ATTRIBUTES. + ([#4856](https://github.com/open-telemetry/opentelemetry-specification/pull/4856)) + ### Entities ### OpenTelemetry Protocol diff --git a/specification/resource/sdk.md b/specification/resource/sdk.md index 8a9a08b4cb0..5fcfcaa742f 100644 --- a/specification/resource/sdk.md +++ b/specification/resource/sdk.md @@ -182,11 +182,15 @@ information provided by the user, i.e. the user provided resource information has higher priority. The `OTEL_RESOURCE_ATTRIBUTES` environment variable will contain of a list of -key value pairs, and these are expected to be represented in a format matching -to the [W3C Baggage](https://www.w3.org/TR/baggage/#header-content), except that additional -semi-colon delimited metadata is not supported, i.e.: `key1=value1,key2=value2`. -All attribute values MUST be considered strings and characters outside the -`baggage-octet` range MUST be percent-encoded. +key value pairs, represented as `key1=value1,key2=value2`. +All attribute values MUST be considered strings. The `,` and `=` characters +in keys and values MUST be percent encoded. Other characters MAY be +[percent-encoded](https://datatracker.ietf.org/doc/html/rfc3986#section-2.1), +e.g. values outside the ANSI characters set. + +In case of any error, e.g. failure during the decoding process, the entire environment +variable value SHOULD be discarded and an error SHOULD be reported following the +[Error Handling principles](../error-handling.md#basic-error-handling-principles). ## Resource operations