opentelemetry-js icon indicating copy to clipboard operation
opentelemetry-js copied to clipboard

feat(otlp-exporter-http): add retries

Open svetlanabrennan opened this issue 3 years ago • 6 comments
trafficstars

Which problem is this PR solving?

Trying to implement retry logic in the export method inside the trace-otlp-http exporter. I'm opening this draft PR to get some feedback on this solution. Any feedback would be greatly appreciated!

The exporter spec is asking the retry logic to include an exponential back-off with jitter. Currently this solution doesn't include the "jitter" portion.

Changes made:

  • Updated the OTLPExporterBase class in exporter-trace-otlp-http to include retry logic
  • Moved timer logic around property exportTimeoutMillis from the BatchSpanProcessorBase class in the sdk-trace-base to OTLPExporterBase class in exporter-trace-otlp-http
  • Updated SpanExporter interface in sdk-trace-base to include optional parameters that are being used by the export method in the OTLPExporterBase class

Fixes # 1233

Short description of the changes

Type of change

  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Tests not written yet. I tested this retry logic locally on an instrumented application.

Checklist:

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

svetlanabrennan avatar Jan 14 '22 16:01 svetlanabrennan

Codecov Report

Merging #2717 (dbce62e) into main (2da6754) will decrease coverage by 0.91%. The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #2717      +/-   ##
==========================================
- Coverage   93.43%   92.51%   -0.92%     
==========================================
  Files         159       75      -84     
  Lines        5452     2819    -2633     
  Branches     1145      541     -604     
==========================================
- Hits         5094     2608    -2486     
+ Misses        358      211     -147     
Impacted Files Coverage Δ
...s/exporter-trace-otlp-http/src/OTLPExporterBase.ts
...entelemetry-propagator-b3/src/B3MultiPropagator.ts
...ckages/opentelemetry-core/src/utils/environment.ts
packages/opentelemetry-resources/src/Resource.ts
packages/opentelemetry-core/src/baggage/utils.ts
...lemetry-resources/src/detectors/ProcessDetector.ts
...es/opentelemetry-core/src/propagation/composite.ts
...elemetry-sdk-trace-base/src/BasicTracerProvider.ts
...ackages/opentelemetry-exporter-zipkin/src/utils.ts
...ontext-async-hooks/src/AsyncHooksContextManager.ts
... and 74 more

codecov[bot] avatar Jan 14 '22 16:01 codecov[bot]

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[bot] avatar Apr 18 '22 06:04 github-actions[bot]

Not stale merely waiting on other things I think?

dyladan avatar Apr 18 '22 19:04 dyladan

Yes it's not stale. Waiting on timeout pr which will be ready for final review soon now that we're back to a single lerna monorepo.

svetlanabrennan avatar Apr 18 '22 22:04 svetlanabrennan

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[bot] avatar Jun 20 '22 06:06 github-actions[bot]

Not stale. Will update this pr soon now that timeout pr was approved/merged.

svetlanabrennan avatar Jun 29 '22 16:06 svetlanabrennan

Closing this draft pr in favor of this one: https://github.com/open-telemetry/opentelemetry-js/pull/3207

svetlanabrennan avatar Aug 26 '22 18:08 svetlanabrennan