Skip to content

Restore per-attempt retry logging in OkHttpGrpcSender - #8967

Draft
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/okhttp-grpc-sender-retry-attempt-logging
Draft

thswlsqls wants to merge 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

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-10-19 00:48 UTC

Move out of draft to request review.

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.
  • 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).

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.

This branch has not been deployed

No deployments
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

1 participant