Repository navigation
Description
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.exportedhaserror.type=13for all spans. INTERNALis not retryable, so nothing is duplicated, but a real failure can't be told apart.- Metrics exports fail the same way.
Steps to reproduce
- 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]
- Run an app with the Java agent (2.33.1, SDK 1.67.0) and
opentelemetry-compressor-zstd
(1.62.1-alpha) withzstd-jniin an agent extension, and:OTEL_EXPORTER_OTLP_PROTOCOL=grpc OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 OTEL_EXPORTER_OTLP_COMPRESSION=zstd - 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-otlpwithopentelemetry-exporter-sender-okhttp(the default sender),
1.67.0 viaopentelemetry-javaagent2.33.1. The same code is in 1.68.0 and onmain.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:
- Small: when the response is compressed with the request's encoding and the sender can't
decompress it, take the result fromgrpc-status/grpc-messageand 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. - Fuller: let a
Compressoroptionally 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.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
jack-berg commentedon Nov 25, 2026
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.