Skip to content

feat(otlp-exporter-base): make better use of retry timeout#6260

Open
jsokol805 wants to merge 2 commits intoopen-telemetry:mainfrom
jsokol805:jakubso/use-retry-budget/1
Open

feat(otlp-exporter-base): make better use of retry timeout#6260
jsokol805 wants to merge 2 commits intoopen-telemetry:mainfrom
jsokol805:jakubso/use-retry-budget/1

Conversation

@jsokol805
Copy link
Copy Markdown
Contributor

Which problem is this PR solving?

Before these changes, we had effective upper limit of ~15s that we used to try to send data (intial 1s delay, 20% jitter, max 5 attempts).

Short description of the changes

Let's keep the user API the same (just upper timeout limit), but make sure we use up our budget:

  • Bump max attempts to 20
  • Make max backoff dynamic, 20% of whole timeout

This way the behavior better matches user intent - if someone sets e.g. 5 minute timeout, we will do ~13 attempts, with last attempt happening after 4 minutes.

We still keep the minimal backoff of 1000ms which should prevent excessive load on servers.

Type of change

New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Added unit test that checks if we use at least 80% of user-specified timeout

Checklist:

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

Before these changes, we had effective upper limit of ~15s that we
used to try to send data (intial 1s delay, 20% jitter, max 5 attempts).

Let's keep the user API the same (just upper timeout limit), but make
sure we use up our budget:
- Bump max attempts to 20
- Make max backoff dynamic, 20% of whole timeout

This way the behavior better matches user intent - if someone sets e.g.
5 minute timeout, we will do ~13 attempts, with last attempt happening
after 4 minutes.

We still keep the minimal backoff of 1000ms which should prevent
excessive load on servers.
@jsokol805 jsokol805 requested a review from a team as a code owner January 2, 2026 18:43
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.39%. Comparing base (f9a5c36) to head (df9ee2f).
⚠️ Report is 129 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6260      +/-   ##
==========================================
- Coverage   95.40%   95.39%   -0.01%     
==========================================
  Files         316      316              
  Lines        9570     9572       +2     
  Branches     2214     2214              
==========================================
+ Hits         9130     9131       +1     
- Misses        440      441       +1     
Files with missing lines Coverage Δ
...kages/otlp-exporter-base/src/retrying-transport.ts 93.18% <100.00%> (-2.06%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 9, 2026

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions Bot added the stale label Mar 9, 2026
@pichlermarc
Copy link
Copy Markdown
Member

This is currently blocked on #6356 and similar changes in the other SDKs. We currently see issues where if there's not OTel collector, app shutdowns take significantly longer; this PR here would make that issue worse as it stands now.

We still want to merge this once the other PR is in though.

@github-actions github-actions Bot removed the stale label Apr 13, 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.

2 participants