Skip to content

OTLP gRPC exports with a SPI compressor (e.g. zstd) fail when the server responds in the same encoding #9057

Backlog

Description

@kerolloz

Describe the bug

With OkHttpGrpcSender and a compressor other than gzip (for example zstd from
opentelemetry-compressor-zstd), every export to an OpenTelemetry Collector fails with
INTERNAL, although the Collector accepts the data:

WARN io.opentelemetry.exporter.otlp.internal.GrpcExporter - Failed to export 512 spans. Server responded with gRPC status code 13. Error message: Unsupported gRPC message encoding: zstd

The Collector's OTLP receiver (grpc-go) compresses the response with the encoding of the request
when it supports it (server.go:
"attempt to respond with same encoding"). It doesn't check grpc-accept-encoding. Since #8224 (1.61.0),
OkHttpGrpcSender.handleResponse only decompresses gzip responses and turns any other encoding
into INTERNAL, even when it is the encoding the sender used for the request, and the real
grpc-status of the response is 0.

The result:

  • The data is delivered, but the exporter reports every export as failed:
    otel.sdk.exporter.span.exported has error.type=13 for all spans.
  • INTERNAL is not retryable, so nothing is duplicated, but a real failure can't be told apart.
  • Metrics exports fail the same way.

Steps to reproduce

  1. Run a Collector with an OTLP gRPC receiver (tested with otel/opentelemetry-collector-contrib:0.151.0):
    receivers:
      otlp:
        protocols:
          grpc:
            endpoint: 0.0.0.0:4317
    exporters:
      nop: {}
    service:
      pipelines:
        traces:
          receivers: [otlp]
          exporters: [nop]
  2. Run an app with the Java agent (2.33.1, SDK 1.67.0) and opentelemetry-compressor-zstd
    (1.62.1-alpha) with zstd-jni in an agent extension, and:
    OTEL_EXPORTER_OTLP_PROTOCOL=grpc
    OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
    OTEL_EXPORTER_OTLP_COMPRESSION=zstd
    
  3. Generate some spans.

In a 60-second run at ~6,500 spans/s, the Collector accepted all spans
(otelcol_receiver_accepted_spans, otelcol_receiver_refused_spans = 0), while the SDK counted all
390,144 of them as failed with error.type=13.

What did you expect to see?

The export succeeds, as it does with gzip, or with zstd over http/protobuf.

What did you see instead?

Every export fails with INTERNAL: Unsupported gRPC message encoding: zstd.

What version and what artifacts are you using?

  • opentelemetry-exporter-otlp with opentelemetry-exporter-sender-okhttp (the default sender),
    1.67.0 via opentelemetry-javaagent 2.33.1. The same code is in 1.68.0 and on main.
  • io.opentelemetry.contrib:opentelemetry-compressor-zstd:1.62.1-alpha

Environment

Runtime: Amazon Corretto 21.0.10. OS: macOS 26 (Apple Silicon). Collector in Docker.

Additional context

The response body of an OTLP export only carries partial_success, and Compressor has no
decompression, so I see two options:

  1. Small: when the response is compressed with the request's encoding and the sender can't
    decompress it, take the result from grpc-status/grpc-message and skip the body (losing the
    partial success details in that case). Encodings the sender didn't send are still rejected with
    INTERNAL, as Response body bounds #8224 intended. I can open a PR for this.
  2. Fuller: let a Compressor optionally decompress (for example a default method), so the
    sender can also read partial success from such responses. It is an addition to a stable SPI,
    and compressors like the contrib zstd one would need to implement it.

I haven't checked the grpc-java ManagedChannel sender. It would probably also fail, since
grpc-java's DecompressorRegistry has no zstd.

Activity

  1. added
    Bug
    on Nov 24, 2026
  2. jack-berg commented on Nov 25, 2026

    @jack-berg
    Member

    See my response to the PR here: #9058 (review)

    TL;DR - I think the collector and go-grpc are non-compliant, and the INTERNAL status code is appropriate here. And I think we need to address the core problem that we only support gzip decompression more holistically.

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

    Bug

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions