OTLP gRPC exporter reads RetryInfo only from the google.rpc.retryinfo-bin trailer, not from the status details

Ouverte
#5,942 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 2 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
72/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
grpc, python

Piste de recherche

Start in exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py around the RetryInfo trailer handling at lines 432–440. Read the gRPC status details handling and the test in exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py, which currently mocks only google.rpc.retryinfo-bin. Done means RetryInfo in grpc-status-details-bin sets the retry delay, with the existing trailer behavior covered as a fallback.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

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:

https://github.com/open-telemetry/opentelemetry-python/blob/ad755945ad69008219e661c33ff1d72ff1bbcb51/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py#L432-L440

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

  1. Run a gRPC OTLP server whose Export returns UNAVAILABLE (or RESOURCE_EXHAUSTED) built with status.New(code, msg).WithDetails(&errdetails.RetryInfo{RetryDelay: durationpb.New(3 * time.Second)}).
  2. Export a span with OTLPSpanExporter to it.
  3. 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.

Langage dominant
Python
Étoiles
2.7k
Forks
1.1k
Merge moyen
4 j 13 min
PR mergées (30 j)
38

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de open-telemetry/opentelemetry-python

Toutes les issues de open-telemetry/opentelemetry-python

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.