Repository navigation
Conversation
A batch size larger than the queue can never fill, so since the worker waits for a full batch, spans were exported only when the schedule delay expired and dropped in between. Use max_queue_size instead and warn. A max_queue_size of 0 is left alone, since a batch size of 0 makes the worker spin.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4727 +/- ##
==========================================
+ Coverage 86.69% 86.72% +0.03%
==========================================
Files 527 528 +1
Lines 20902 20915 +13
==========================================
+ Hits 18119 18136 +17
+ Misses 2783 2779 -4
🚀 New features to boost your workflow:
|
ltowarek
marked this pull request as ready for review
October 23, 2026 05:08
marcalff
approved these changes
Oct 23, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[SDK] Clamp BatchSpanProcessor max_export_batch_size to max_queue_size
Changes
Since #4466,
BatchSpanProcessorwaits for a full batch before it exports. Ifmax_export_batch_sizeis larger thanmax_queue_size, a full batch never arrives. Spans are then exported only whenschedule_delay_millisexpires, and new spans are dropped once the queue is full.The specification says the batch size must be less than or equal to the queue size, so such values are invalid. They still worked before #4466, though. Since #4466, apps that use them lose spans, and nothing points at the configuration as the cause.
The fix is based on the Java and Python SDKs, which both refuse such values. Java clamps the batch size to the queue size and logs a warning (BatchSpanProcessorBuilder). Python raises a
ValueError(BatchSpanProcessor). opentelemetry-cpp must also work without exceptions, so this PR does what Java does: it clamps and logs one warning at construction. Amax_queue_sizeof 0 is left alone, because clamping to it would make the worker spin.For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes