Add exemplar reservoir parallel benchmarks#7441
Merged
pellared merged 8 commits intoopen-telemetry:mainfrom Oct 3, 2025
Merged
Add exemplar reservoir parallel benchmarks#7441pellared merged 8 commits intoopen-telemetry:mainfrom
pellared merged 8 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7441 +/- ##
=======================================
- Coverage 85.7% 85.7% -0.1%
=======================================
Files 284 284
Lines 25001 25006 +5
=======================================
+ Hits 21437 21441 +4
- Misses 3185 3186 +1
Partials 379 379
🚀 New features to boost your workflow:
|
89ff225 to
6b0b66e
Compare
6b0b66e to
1631ed7
Compare
572360f to
6990fa0
Compare
This was referenced Oct 2, 2025
MrAlias
approved these changes
Oct 2, 2025
dashpole
added a commit
that referenced
this pull request
Oct 2, 2025
See #7441 ``` ### Errors in sdk/metric/exemplar/fixed_size_reservoir.go * [403] <https://dl.acm.org/doi/10.1145/198429.198435> | Rejected status code (this depends on your "accept" configuration): Forbidden ```
dmathieu
approved these changes
Oct 3, 2025
pellared
approved these changes
Oct 3, 2025
dashpole
added a commit
that referenced
this pull request
Jan 23, 2026
~Depends on #7441, #7443~ This improves the concurrent performance of the fixed size reservoir's Offer function by 4x (i.e. 75% reduction). This improves the performance of Measure() for fixed-size reservoirs by 60% overall. Accomplish this by: * using a single atomic for count and next. This assumes that both can fit in a uint32. * only use a lock to guard changing `w` and `next` together. Offer benchmarks: ``` │ main.txt │ fixedsize.txt │ │ sec/op │ sec/op vs base │ FixedSizeReservoirOffer-24 185.25n ± 4% 45.58n ± 1% -75.40% (p=0.002 n=6) ``` Measure benchmarks: ``` │ main.txt │ fixedsize.txt │ │ sec/op │ sec/op vs base │ SyncMeasure/NoView/ExemplarsEnabled/Int64Counter/Attributes/0-24 175.45n ± 6% 67.01n ± 9% -61.81% (p=0.002 n=6) SyncMeasure/NoView/ExemplarsEnabled/Int64Counter/Attributes/1-24 170.25n ± 1% 69.82n ± 6% -58.99% (p=0.002 n=6) SyncMeasure/NoView/ExemplarsEnabled/Int64Counter/Attributes/10-24 167.40n ± 2% 64.52n ± 10% -61.46% (p=0.002 n=6) SyncMeasure/NoView/ExemplarsEnabled/Float64Counter/Attributes/0-24 173.55n ± 0% 69.17n ± 12% -60.14% (p=0.002 n=6) SyncMeasure/NoView/ExemplarsEnabled/Float64Counter/Attributes/1-24 169.50n ± 1% 68.55n ± 5% -59.56% (p=0.002 n=6) SyncMeasure/NoView/ExemplarsEnabled/Float64Counter/Attributes/10-24 166.95n ± 1% 65.82n ± 6% -60.58% (p=0.002 n=6) SyncMeasure/NoView/ExemplarsEnabled/Int64UpDownCounter/Attributes/0-24 168.85n ± 1% 67.99n ± 11% -59.73% (p=0.002 n=6) SyncMeasure/NoView/ExemplarsEnabled/Int64UpDownCounter/Attributes/1-24 173.50n ± 1% 66.69n ± 2% -61.56% (p=0.002 n=6) SyncMeasure/NoView/ExemplarsEnabled/Int64UpDownCounter/Attributes/10-24 171.30n ± 5% 67.73n ± 8% -60.46% (p=0.002 n=6) SyncMeasure/NoView/ExemplarsEnabled/Float64UpDownCounter/Attributes/0-24 168.90n ± 2% 67.69n ± 9% -59.92% (p=0.002 n=6) SyncMeasure/NoView/ExemplarsEnabled/Float64UpDownCounter/Attributes/1-24 173.35n ± 2% 68.25n ± 9% -60.63% (p=0.002 n=6) SyncMeasure/NoView/ExemplarsEnabled/Float64UpDownCounter/Attributes/10-24 172.95n ± 2% 70.90n ± 7% -59.01% (p=0.002 n=6) geomean 171.0n 67.83n -60.33% ``` --------- Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com> Co-authored-by: Robert Pająk <pellared@hotmail.com>
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.
This also fixes a bug introduced in #7423, where we were only locking around storage and not around other shared fields (e.g. count). Fixing the bug is required for benchmarks to run properly, but wasn't caught by concurrent safe tests because the SDK does not currently call exemplar methods concurrently.