Skip to content

otlpmetric, otlptrace: interpret compression environment enums case-insensitively #9262

Open

Description

@sushant-me

Description

The log exporters interpret compression environment values case-insensitively (#9141, #9133); #9230 lands that by lowercasing the value in convCompression before matching.

The metric and trace exporters still compare exactly, so the shared variable behaves differently depending on the signal. With OTEL_EXPORTER_OTLP_COMPRESSION=GZIP, the log exporters use gzip and the metric and trace exporters silently use no compression.

Four WithEnvCompression implementations parse the value with if v == "gzip":

  • exporters/otlp/otlpmetric/otlpmetricgrpc/internal/oconf/envconfig.go
  • exporters/otlp/otlpmetric/otlpmetrichttp/internal/oconf/envconfig.go
  • exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go
  • exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/envconfig.go

The specification's environment enum guidance asks for case-insensitive interpretation, which is why #9141 and #9133 were filed for the log exporters.

This issue tracks bringing the metric and trace exporters in line with the log ones, so that a single shared variable resolves the same way for every signal. Work for the individual signals can reference this issue.

Environment

  • OS: all
  • Architecture: all
  • Go Version: all supported
  • opentelemetry-go version: main

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions