fix(sdk-logs): Fix Not Exporting Upon _maxExportBatchSize#5961
fix(sdk-logs): Fix Not Exporting Upon _maxExportBatchSize#5961trentm merged 14 commits intoopen-telemetry:mainfrom
_maxExportBatchSize#5961Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5961 +/- ##
==========================================
- Coverage 95.23% 95.22% -0.01%
==========================================
Files 311 311
Lines 8596 8603 +7
Branches 1799 1801 +2
==========================================
+ Hits 8186 8192 +6
- Misses 410 411 +1
🚀 New features to boost your workflow:
|
trentm
left a comment
There was a problem hiding this comment.
Thanks for taking this on. We definitely should fix the issue.
|
Marc reminded me that this exporting code originally derives from the batch Span exporter. And there was a PR there doing a similar thing. I haven't looked at it, but this PR might have changes that could be borrowed: #3958 |
_maxExportBatchSize_maxExportBatchSize
| ### :bug: Bug Fixes | ||
|
|
||
| * fix(sdk-logs): Fix the `batchLogProcessor` exporting only upon `_scheduledDelayMillis` and ignoring `maxExportBatchSize` [#5961](https://github.com/open-telemetry/opentelemetry-js/pull/5961) @jacksonweber | ||
| * test(shim-opentracing): add comparison thresholds in flaky assertions [#5974](https://github.com/open-telemetry/opentelemetry-js/pull/5974) @cjihrig |
There was a problem hiding this comment.
This line shouldn't have been moved. I think this is an accidental mismerge from #5987.
The changelog line for this PR should also be in experimental/CHANGELOG.md rather than this file.
I'll fix in a sec.
Which problem is this PR solving?
This pull request addresses a bug in the log batching processor so that logs are exported immediately when the batch size limit is reached, rather than waiting for the scheduled delay. It also adds and improves tests to ensure the correct export behavior for both full and partial batches, and clarifies the logic for queue size limits.
Bug Fixes and Core Logic:
batchLogProcessorso that it exports logs immediately whenmaxExportBatchSizeis reached, instead of waiting for_scheduledDelayMillis. This ensures timely log delivery and corrects previous batching behavior. [1] [2] [3]Fixes #5706
Type of change
How Has This Been Tested?
BatchLogRecordProcessor.test.tsto cover immediate export on batch size, timer-based export for partial batches, multiple immediate exports, and correct handling of queue size limits. [1] [2]Checklist: