Repository navigation
Description
Describe your environment
opentelemetry-exporter-otlp-proto-grpc 1.45.2 (the code is the same on main).
What happened?
The OTLP gRPC exporter reads the server's RetryInfo only from a trailer named google.rpc.retryinfo-bin:
Lines 432 to 440 in ad75594
| retry_info_bin = dict(error.trailing_metadata()).get( # type: ignore [reportAttributeAccessIssue] | |
| "google.rpc.retryinfo-bin" # type: ignore [reportArgumentType] | |
| ) | |
| # multiplying by a random number between .8 and 1.2 introduces a +/20% jitter to each backoff. | |
| backoff_seconds = 2**retry_num * random.uniform(0.8, 1.2) | |
| if retry_info_bin is not None: | |
| retry_info = RetryInfo() | |
| retry_info.ParseFromString(retry_info_bin) | |
| backoff_seconds = retry_info.retry_delay.seconds + retry_info.retry_delay.nanos / 1.0e9 |
The OTLP specification tells a server to send RetryInfo as a detail of the gRPC status (Failures, OTLP/gRPC Throttling). Its sample server code uses status.New(...).WithDetails(&errdetails.RetryInfo{...}). gRPC sends those details in the grpc-status-details-bin trailer, as an encoded google.rpc.Status. A server that follows the specification, such as one written with grpc-go or the OpenTelemetry Collector's receiver, sends no google.rpc.retryinfo-bin trailer.
So the Python exporter never sees the delay that such a server asks for. It falls back to its own backoff of 2**n * uniform(0.8, 1.2) seconds. The OTel Go SDK, the Collector's exporter and the .NET exporter read the delay from the status details.
Steps to Reproduce
- Run a gRPC OTLP server whose
ExportreturnsUNAVAILABLE(orRESOURCE_EXHAUSTED) built withstatus.New(code, msg).WithDetails(&errdetails.RetryInfo{RetryDelay: durationpb.New(3 * time.Second)}). - Export a span with
OTLPSpanExporterto it. - Log the time of each attempt on the server.
Expected Result
The exporter waits the 3 s that RetryInfo asks for before it retries.
Actual Result
The exporter retries after about 1 s, then 2 s, then 4 s: its own backoff. The RetryInfo in grpc-status-details-bin is ignored.
Additional context
A fix could decode grpc-status-details-bin as google.rpc.status_pb2.Status (or use grpc_status.rpc_status.from_call), take the RetryInfo from its details, and keep the google.rpc.retryinfo-bin lookup as a fallback. The test at exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py mocks only the google.rpc.retryinfo-bin trailer.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
Dageus commentedon Nov 17, 2026
I'd like to pick this up and submit a fix as my first contribution here.