PoC for batching in PeriodicReader#7930
Closed
dashpole wants to merge 1 commit intoopen-telemetry:mainfrom
Closed
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7930 +/- ##
=======================================
- Coverage 81.7% 81.5% -0.2%
=======================================
Files 304 305 +1
Lines 23283 23430 +147
=======================================
+ Hits 19032 19116 +84
- Misses 3864 3926 +62
- Partials 387 388 +1
🚀 New features to boost your workflow:
|
3 tasks
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.
Batching logic is based on the collector's batchprocessor: https://github.com/open-telemetry/opentelemetry-collector/blob/587b90b9ecc1db959ee9104d5bf993591f80ca43/processor/batchprocessor/splitmetrics.go
PoC for open-telemetry/opentelemetry-specification#4895
This PR adds
metric.WithMaxExportBatchSizetogo.opentelemetry.io/sdk/metric, and causes the SDK to split batches before passing them to the exporter.One potential issue is that I was hoping the export timeout could be applied individually to each batch, rather than to multiple serial export calls. But currently, we apply the timeout to collect + export. I've changed it to apply the timeout individually to collect, and to each export, but I'm curious how acceptable other maintainers think this kind of change would be. In practice, I suspect Collect() is not a notable source of latency or timeouts.
The spec for the timeout says:
It would strike me as a bit odd if we did split metrics into batches to have the timeout still applied to the entire collect + multiple exports based on the spec.