Skip to content

Retry OTLP/HTTP exports on HTTP 429 (Too Many Requests) (#3122) - #5473

Closed
srijavuppala wants to merge 3 commits into
open-telemetry:mainfrom
srijavuppala:fix/otlp-http-retry-429
Closed

Retry OTLP/HTTP exports on HTTP 429 (Too Many Requests) (#3122)#5473
srijavuppala wants to merge 3 commits into
open-telemetry:mainfrom
srijavuppala:fix/otlp-http-retry-429

Conversation

@srijavuppala

Copy link
Copy Markdown

Description

The _is_retryable helper shared by the OTLP/HTTP trace, metric and log exporters
(exporter/opentelemetry-exporter-otlp-proto-http/.../http/_common/__init__.py) treated
408 and any 5xx response as retryable, but not 429 (Too Many Requests). Since 429
is neither 408 nor in the 500599 range, a throttled export was reported as a
non-retryable failure and dropped instead of being retried with backoff.

The OTLP specification lists 429 as a retryable status code
(otlp.md#failures-1),
so this adds 429 to _is_retryable.

This change is intentionally limited to the missing, spec-required 429 case and does not
alter the existing 408/5xx handling, to avoid the broader 5xx-narrowing question raised
in the issue.

Fixes #3122

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Added exporter/opentelemetry-exporter-otlp-proto-http/tests/test_common.py, a direct unit
    test of _is_retryable covering retryable status codes (408, 429, 500, 502, 503,
    504, 599) and non-retryable ones (200, 400, 401, 403, 404, 409).
  • Ran the full existing OTLP/HTTP exporter test suite (80 tests) — all pass.
  • ruff check and ruff format --check pass on the changed files.

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 29, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

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
srijavuppala force-pushed the fix/otlp-http-retry-429 branch from 59a9439 to 4478165 Compare July 29, 2026 16:53
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.
@herin049

Copy link
Copy Markdown
Contributor

This is already being addressed by #5389

@herin049 herin049 closed this Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OTLP/HTTP exporter should honour the spec retry status codes

2 participants