Repository navigation
fix(sdk): first async export after one interval, not two - #3901
Merged
cijothomas merged 1 commit intoDec 4, 2026
Merged
cijothomas merged 1 commit into
cijothomas merged 1 commit into
Conversation
The periodic ticker built by to_interval_stream already delays before its first tick, so the extra .skip(1) made the first metrics collection and batch flush wait two intervals. Remove the skip from the async PeriodicReader, BatchSpanProcessor and BatchLogProcessor so they match the thread-based processors, and add a regression test that fails if the skip is restored.
Pull request dashboard statusMerged · refreshed 2026-12-04 02:12 UTC Status above doesn't look right?
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3901 +/- ##
=====================================
Coverage 86.7% 86.7%
=====================================
Files 131 131
Lines 34712 34756 +44
=====================================
+ Hits 30116 30159 +43
- Misses 4596 4597 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
cijothomas
approved these changes
Dec 4, 2026
cijothomas
left a comment
Member
There was a problem hiding this comment.
Thanks! Looks good.
(IIRC, I added the skip(1) long ago, but we missed to remove it when the interval imply was changed later)
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.
Fixes #3897
Changes
to_interval_streamsleeps before every tick, including the first (unfoldyields only afterruntime.delayresolves). The experimental async-runtimePeriodicReader,BatchSpanProcessorandBatchLogProcessorstill called.skip(1)on top of it, so their first collection/flush waited two intervals. The thread-based processors export after one interval.Removed the three
.skip(1)calls inmetrics/periodic_reader_with_async_runtime.rs,trace/span_processor_with_async_runtime.rsandlogs/log_processor_with_async_runtime.rs, and added the regression testfirst_collection_happens_after_one_interval.The test uses a fake
Runtimewhosedelayis held until the test releases it: it asserts the worker waits exactly one interval before collecting, then releases only that first tick and asserts a collection happens. With.skip(1)restored the test fails (no collection within 5s); without it, it passes. Full suite:cargo test -p opentelemetry_sdk --all-features --lib-> 514 passed, 25 ignored.cargo fmt --checkandcargo clippy -p opentelemetry_sdk --all-targets --all-features -- -Dwarningsare clean.Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial, user-facing changes