Retry OTLP/HTTP exports on HTTP 429 (Too Many Requests) (#3122) - #5473
Closed
srijavuppala wants to merge 3 commits into
Closed
Retry OTLP/HTTP exports on HTTP 429 (Too Many Requests) (#3122)#5473srijavuppala wants to merge 3 commits into
srijavuppala wants to merge 3 commits into
Conversation
srijavuppala
added a commit
to srijavuppala/opentelemetry-python
that referenced
this pull request
Jul 29, 2026
…ry#3122) The shared `_is_retryable` helper used by the OTLP/HTTP trace, metric and log exporters retried on 408 and 5xx responses, but not on 429 (Too Many Requests). The OTLP specification lists 429 as a retryable status code, so a throttled export was being dropped instead of retried with backoff. Add 429 to `_is_retryable` and a direct unit test covering the retryable and non-retryable status codes. This is intentionally limited to the missing, spec-required 429 case and does not change the existing 408/5xx handling.
srijavuppala
force-pushed
the
fix/otlp-http-retry-429
branch
from
July 29, 2026 16:53
59a9439 to
4478165
Compare
Add test_retryable_status_code_429 to the trace, metric and log OTLP/HTTP exporter test suites, asserting that a 429 (Too Many Requests) response is retried (more than one POST attempt) rather than dropped. This complements the shared _is_retryable unit test by covering the retry behaviour end-to-end for each signal.
Contributor
|
This is already being addressed by #5389 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
_is_retryablehelper shared by the OTLP/HTTP trace, metric and log exporters(
exporter/opentelemetry-exporter-otlp-proto-http/.../http/_common/__init__.py) treated408and any5xxresponse as retryable, but not429(Too Many Requests). Since429is neither
408nor in the500–599range, a throttled export was reported as anon-retryable failure and dropped instead of being retried with backoff.
The OTLP specification lists
429as a retryable status code(otlp.md#failures-1),
so this adds
429to_is_retryable.This change is intentionally limited to the missing, spec-required
429case and does notalter the existing
408/5xxhandling, to avoid the broader5xx-narrowing question raisedin the issue.
Fixes #3122
Type of change
How Has This Been Tested?
exporter/opentelemetry-exporter-otlp-proto-http/tests/test_common.py, a direct unittest of
_is_retryablecovering retryable status codes (408,429,500,502,503,504,599) and non-retryable ones (200,400,401,403,404,409).ruff checkandruff format --checkpass on the changed files.Does This PR Require a Contrib Repo Change?
Checklist: