-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add export sync #5105
Add export sync #5105
Conversation
The batching log processor will generate records from 4 different locations (polling, OnEmit, ForceFlush, Shutdown). In order to ensure an Exporter is called serially, as is required by the interface, this function will be used in the processor to centralize the interaction with its Exporter. Part of open-telemetry#5063. See open-telemetry#5093 for the implementation use.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5105 +/- ##
=====================================
Coverage 83.8% 83.8%
=====================================
Files 248 248
Lines 16203 16221 +18
=====================================
+ Hits 13581 13599 +18
Misses 2334 2334
Partials 288 288
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why did you choose this approach, rather than just locking around the exporter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Locking around the exporter would mean the calling goroutine would need to wait for the export to complete before continuing. Either the batching processor routine, or the polling routine will be blocked in that case. Either of which is going to be problematic as it could cause large back-pressure for systems with high throughput. Passing via a channel to a separate goroutine will allow the the export to not block, and if the export becomes excessively slow we can start dropping payloads instead of locking up. |
The batching log processor will generate records from 4 different locations (polling, OnEmit, ForceFlush, Shutdown). In order to ensure an Exporter is called serially, as is required by the interface, this function will be used in the processor to centralize the interaction with its Exporter.
Part of #5063.
See #5093 for the implementation use.