Open pellared opened 4 months ago
I will open a PR for it...
the OTLPlog should be updated as well, I have raised an issue related https://github.com/open-telemetry/opentelemetry-go/issues/5722, and will implement a fix soon
@zhihali, this is for all OTLP exporters. I see that OTLP trace and metric exporters are already fixed. Therefore, only OTLP log exporters need bugfixes.
The OTLP exporters SHOULD NOT percent decode the header keys when parsing
OTEL_EXPORTER_OTLP_HEADERS
,OTEL_EXPORTER_OTLP_TRACES_HEADERS
,OTEL_EXPORTER_OTLP_METRICS_HEADERS
,OTEL_EXPORTER_OTLP_LOGS_HEADERS
env vars. Moreover, only valid header keys should be parsed.Current behavior:
https://github.com/open-telemetry/opentelemetry-go/blob/29bdfd20e07a156f22a9c9148066aae6527f8219/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go#L166-L170
The specification says https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#specifying-headers-via-environment-variables:
From W3C Baggage spec https://www.w3.org/TR/baggage/#key:
There is nothing about percent encoding. Only the values are supposed to be percent decoded.
Notice that the implementation should also make sure that only valid key characters are used.