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

fix(async-processor): concurrent exports actually serialised

Open alexbrt opened this issue 5 months ago • 2 comments

https://github.com/open-telemetry/opentelemetry-rust/pull/2685 unintentionally broke parallel exports by awaiting the export() future directly in opentelemetry-sdk/src/trace/span_processor_with_async_runtime.rs, rather than passing it to the runtime for concurrent polling. As a result, OTEL_BSP_MAX_CONCURRENT_EXPORTS became ineffective, serialising all exports and increasing the risk of dropped spans under load.

This PR restores true parallelism by respecting max_concurrent_exports, and adds tests to verify:

  • Exports run in parallel when max_concurrent_exports > 1
  • Exports are serialised when max_concurrent_exports == 1

Merge requirement checklist

  • [x] CONTRIBUTING guidelines followed
  • [x] Unit tests added/updated (if applicable)
  • [x] Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • [x] Changes in public API reviewed (if applicable)

alexbrt avatar Jun 18 '25 14:06 alexbrt

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: TommyCpp / name: Zhongyang Wu (8346e30039c291bdf9a1587492fd011e25fd17b2)
  • :white_check_mark: login: alexbrt / name: Alexandru-Liviu Bratosin (1905b50d97eef20811e8624d503172834e3f678d, d8e046e7253fb65ff9feb3d13a0e9dd28d8aff75, 2076120fbc16cd4b34eb061f56c94e20e66bcfe3, f7faf804e4572ac47407dfa6c05f340510a77806)

Codecov Report

Attention: Patch coverage is 94.73684% with 5 lines in your changes missing coverage. Please review.

Project coverage is 80.2%. Comparing base (5e447d0) to head (8346e30). Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...sdk/src/trace/span_processor_with_async_runtime.rs 94.7% 5 Missing :warning:
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #3028     +/-   ##
=======================================
+ Coverage   80.0%   80.2%   +0.1%     
=======================================
  Files        126     126             
  Lines      21879   21949     +70     
=======================================
+ Hits       17519   17604     +85     
+ Misses      4360    4345     -15     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Jun 18 '25 14:06 codecov[bot]

@lalitb @cijothomas Thanks again for all the reviews! 🙏 Is there anything else outstanding that needs to be addressed before this can be merged?

alexbrt avatar Jun 24 '25 10:06 alexbrt

Any updates here? :eyes:

alexbrt avatar Jul 11 '25 15:07 alexbrt