Skip to content

Respect Retry-After in OTLP HTTP senders - #8633

Open
ADITYA-CODE-SOURCE wants to merge 1 commit into
open-telemetry:mainfrom
ADITYA-CODE-SOURCE:issue-8449-otlp-retry-after
Open

Respect Retry-After in OTLP HTTP senders#8633
ADITYA-CODE-SOURCE wants to merge 1 commit into
open-telemetry:mainfrom
ADITYA-CODE-SOURCE:issue-8449-otlp-retry-after

Conversation

@ADITYA-CODE-SOURCE

Copy link
Copy Markdown
Contributor

Summary:

  • honor OTLP/HTTP Retry-After headers in the OkHttp and JDK HTTP senders
  • support both delay-seconds and RFC1123 HTTP-date values, with existing exponential backoff as the fallback
  • add shared parser coverage plus sender and OTLP integration tests for seconds/date/malformed cases

Fixes #8449

Testing:

  • ./gradlew :exporters:common:test --tests "*RetryUtilTest"
  • ./gradlew :exporters:sender:okhttp:test --tests "*RetryInterceptorTest"
  • ./gradlew :exporters:sender:jdk:test --tests "*JdkHttpSenderTest"
  • ./gradlew :exporters:otlp:all:testOkHttpVersionLATEST --tests "OtlpHttp"
  • ./gradlew :exporters:otlp:all:testJdkHttpSender --tests "OtlpHttp"
  • ./gradlew :exporters:common:spotlessCheck :exporters:sender:okhttp:spotlessCheck :exporters:sender:jdk:spotlessCheck :exporters:otlp:testing-internal:spotlessCheck :exporters:otlp:all:spotlessCheck :exporters:otlp:all:checkstyleTestOkHttpVersionLATEST :exporters:otlp:all:checkstyleTestJdkHttpSender

@ADITYA-CODE-SOURCE
ADITYA-CODE-SOURCE requested a review from a team as a code owner July 17, 2026 04:21
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 17, 2026

Copy link
Copy Markdown

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

  • ✅ login: ADITYA-CODE-SOURCE / name: Aditya Vishe (675f3c9)

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.45455% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.47%. Comparing base (b86f040) to head (8cd225a).
⚠️ Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
...ry/exporter/sender/jdk/internal/JdkHttpSender.java 88.88% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8633      +/-   ##
============================================
- Coverage     91.60%   91.47%   -0.14%     
- Complexity    10343    10466     +123     
============================================
  Files          1013     1021       +8     
  Lines         27352    27679     +327     
  Branches       3215     3246      +31     
============================================
+ Hits          25057    25318     +261     
- Misses         1567     1617      +50     
- Partials        728      744      +16     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ADITYA-CODE-SOURCE
ADITYA-CODE-SOURCE force-pushed the issue-8449-otlp-retry-after branch from 1249450 to 675f3c9 Compare July 18, 2026 13:26
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Jul 18, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-07-29 01:36 UTC

Respond to 2 review items (e.g. link a commit, explain why not, ask a follow-up):

  • Inline threads: 1, 2
Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Should this be with reviewers? Comment /dashboard route:reviewers to route it to them.
  • Anything wrong — including the routing? Report it with what you expected; it helps us improve the dashboard.

Comment thread exporters/common/src/main/java/io/opentelemetry/exporter/internal/RetryUtil.java Outdated
@ADITYA-CODE-SOURCE
ADITYA-CODE-SOURCE force-pushed the issue-8449-otlp-retry-after branch from 675f3c9 to 8cd225a Compare July 25, 2026 08:36
@ADITYA-CODE-SOURCE

Copy link
Copy Markdown
Contributor Author

@jack-berg I pushed a follow-up in 8cd225ad addressing the review feedback.

This update:

  • honors Retry-After for any retryable HTTP status code
  • clamps JDK retry sleep to the remaining timeout budget
  • moves parsing edge cases into RetryUtilTest
  • trims the higher-level HTTP exporter coverage
  • reduces the extra constructor/test seams

Could you please take another look?

@jack-berg jack-berg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple more minor comments. Looks pretty good!

class RetryUtilTest {

@Test
void retryAfterNull() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests in here are perfect candidates for a parameterized test.

}

@Test
void retryableError_malformedRetryAfterFallsBack() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any observable different between this malformed case and the retryableError_retryAfterHonored case? For example, Could we configure the retry policy min / max backoff in a way that makes it clear when the time from the policy is being used vs the time in the Retry-After header?

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 exporters should respect retry-after

2 participants