Skip to content

Restore per-attempt retry logging in OkHttpGrpcSender - #8967

Merged
jack-berg merged 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/okhttp-grpc-sender-retry-attempt-logging
Nov 3, 2026
Merged

jack-berg merged 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/okhttp-grpc-sender-retry-attempt-logging

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Fixes #8966

Related to #8854, #6614

Description

  • Retry ConnectException, add retry logging #6614 added FINER logs for each retry attempt. fix: retry OTLP gRPC responses with trailer status #8854 moved gRPC retries from RetryInterceptor into OkHttpGrpcSender.sendAttempt() and dropped them.
  • This restores them in the attempt callback, with the level and wording of RetryInterceptor and JdkHttpSender: Attempt N failed with (non-)retryable exception (exception passed as the Throwable) and Attempt N returned (non-)retryable response: ....
  • The response suffix shows the gRPC status and message, since the OkHttp Response is no longer at hand.
  • The exception predicate now runs once before the retry checks, so it is also called on the last attempt. RetryInterceptor does the same.
  • Logs are written only when retry is enabled, as before. The logger is now OkHttpGrpcSender instead of RetryInterceptor (same package).

Testing done

  • Added OkHttpGrpcSenderTest#send_retryEnabled_logsEachFailedAttempt: closed port, 2 attempts; expects Attempt 0 ... and Attempt 1 failed with retryable exception.
  • With the main-code change reverted, the test fails (no log records).
  • ./gradlew :exporters:sender:okhttp:check passed, 57 tests. internal package, no apidiff change.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-11-03 22:26 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 40.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.40%. Comparing base (b32298a) to head (fcbd32e).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
...orter/sender/okhttp/internal/OkHttpGrpcSender.java 40.00% 4 Missing and 2 partials ⚠️

❌ Your patch check has failed because the patch coverage (40.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8967      +/-   ##
============================================
- Coverage     90.40%   90.40%   -0.01%     
  Complexity    10898    10898              
============================================
  Files          1015     1015              
  Lines         29843    29850       +7     
  Branches       3896     3899       +3     
============================================
+ Hits          26981    26986       +5     
- Misses         1910     1911       +1     
- Partials        952      953       +1     

☔ 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.

@thswlsqls
thswlsqls marked this pull request as ready for review October 22, 2026 23:27
@thswlsqls
thswlsqls requested a review from a team as a code owner October 22, 2026 23:27

@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.

Thanks

@jack-berg
jack-berg merged commit 1acb73a into open-telemetry:main Nov 3, 2026
34 of 35 checks passed
@otelbot

otelbot Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution @thswlsqls! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

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.

OkHttpGrpcSender no longer logs retry attempts

2 participants