Skip to content

feat(otlp-grpc): add retry logic and comprehensive error handling to …#2076

Open
arjun-rajappa wants to merge 5 commits into
open-telemetry:mainfrom
arjun-rajappa:add-tests-grpc-exporter
Open

feat(otlp-grpc): add retry logic and comprehensive error handling to …#2076
arjun-rajappa wants to merge 5 commits into
open-telemetry:mainfrom
arjun-rajappa:add-tests-grpc-exporter

Conversation

@arjun-rajappa

Copy link
Copy Markdown
Contributor

Closes #1667

Changes

  • Implement exponential backoff retry mechanism for transient gRPC errors
  • Add retry support for Unavailable, DeadlineExceeded, Cancelled, ResourceExhausted, Aborted, Internal, and DataLoss errors
  • Improve certificate handling by reading file contents instead of passing file paths
  • Add timeout support with deadline tracking across retry attempts
  • Implement metrics reporting for export failures
  • Add comprehensive test coverage for error scenarios, retry logic, and edge cases

…trace exporter

- Implement exponential backoff retry mechanism for transient gRPC errors
- Add retry support for Unavailable, DeadlineExceeded, Cancelled, ResourceExhausted, Aborted, Internal, and DataLoss errors
- Improve certificate handling by reading file contents instead of passing file paths
- Add timeout support with deadline tracking across retry attempts
- Implement metrics reporting for export failures
- Add comprehensive test coverage for error scenarios, retry logic, and edge cases

Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this pull request will be closed eventually by the stale bot

Comment thread exporter/otlp-grpc/lib/opentelemetry/exporter/otlp/grpc/trace_exporter.rb Outdated
Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
…ILURE, and RETRY_COUNT

Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>

@kaylareopelle kaylareopelle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for adding all the defensive error handling to the gRPC exporter! I have a few questions about the tests.

Comment thread exporter/otlp-grpc/test/opentelemetry/exporter/otlp/grpc/trace_exporter_test.rb Outdated
Comment thread exporter/otlp-grpc/test/opentelemetry/exporter/otlp/grpc/trace_exporter_test.rb Outdated
- Replace all wont_be_nil assertions in #initialize tests with specific
  equality checks (@timeout, @shutdown, @host) so each test validates
  the exact value that was configured

- Rewrite 'encodes dropped attributes, events, and links counts' to
  intercept the proto request and assert dropped_attributes_count,
  dropped_events_count, and dropped_links_count directly on the span
  proto, rather than only checking the export return value

- Rewrite 'translates all the things' to mirror the pattern in
  otlp-common: create spans via a real TracerProvider using with_ids
  to pin IDs, then build a complete ExportTraceServiceRequest proto and
  assert equality in a single must_equal rather than field-by-field

- Consolidate TRACING_INTEGRATION_TEST guard from individual skip calls
  into a single before block on the 'integration with tracer provider'
  and 'performance' describe groups

Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
@arjun-rajappa arjun-rajappa requested review from a team as code owners June 30, 2026 11:08
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.

Make otlp-http, otlp-grpc, and otlp-common gems production-ready

3 participants