Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BatchSpanProcessor optimizations - Separate control signal queue, and wake up background thread only when required. #2526

Merged
merged 5 commits into from
Jan 21, 2025

Conversation

lalitb
Copy link
Member

@lalitb lalitb commented Jan 21, 2025

Fixes: Towards #2493

Changes

Similar to the BatchLogProcessor in #2494 :

  • wake up the background thread ONLY when needed
  • Separate control signal queue ( to ensure that the shutdown signal is not lost when message queue is full).

Merge requirement checklist

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

@lalitb lalitb requested a review from a team as a code owner January 21, 2025 18:44
@lalitb lalitb added the integration tests Run integration tests label Jan 21, 2025
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

Attention: Patch coverage is 90.51095% with 13 lines in your changes missing coverage. Please review.

Project coverage is 77.9%. Comparing base (78db32c) to head (6d2edf0).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
opentelemetry-sdk/src/trace/span_processor.rs 90.5% 13 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##            main   #2526    +/-   ##
======================================
  Coverage   77.9%   77.9%            
======================================
  Files        123     123            
  Lines      22944   23056   +112     
======================================
+ Hits       17880   17980   +100     
- Misses      5064    5076    +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

&config,
);
// Reset the export span message sent flag now it has has been processed.
export_span_message_sent.store(false, Ordering::Relaxed);
Copy link
Member

Choose a reason for hiding this comment

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

this reset need to happen before the exporting. Just like logs.

Copy link
Member Author

@lalitb lalitb Jan 21, 2025

Choose a reason for hiding this comment

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

Good point. Updated accordingly.

Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

@cijothomas cijothomas merged commit d2a6b3b into open-telemetry:main Jan 21, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration tests Run integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants