Skip to content

exphist: replace min, max, sum, and count with atomics#8025

Merged
dashpole merged 4 commits intoopen-telemetry:mainfrom
dashpole:exphist_part_1
Mar 13, 2026
Merged

exphist: replace min, max, sum, and count with atomics#8025
dashpole merged 4 commits intoopen-telemetry:mainfrom
dashpole:exphist_part_1

Conversation

@dashpole
Copy link
Copy Markdown
Contributor

@dashpole dashpole commented Mar 8, 2026

This is the first PR towards a lockless fast-path for the exponential histogram aggregation. It just replaces use of min, max, sum and counts with atomic types.

You can see the full set of planned changes in main...dashpole:opentelemetry-go:lockless_exphist_ai. The implementation is largely based on #7535 (which I implemented by hand), but with help from an AI to break it down into smaller PRs, and simplify aspects of the design.

Part of #7796

@dashpole dashpole added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Mar 8, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 8, 2026

Codecov Report

❌ Patch coverage is 96.15385% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.6%. Comparing base (82d57cc) to head (3d043ce).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...metric/internal/aggregate/exponential_histogram.go 96.1% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #8025     +/-   ##
=======================================
- Coverage   81.6%   81.6%   -0.1%     
=======================================
  Files        304     304             
  Lines      23452   23446      -6     
=======================================
- Hits       19147   19136     -11     
- Misses      3923    3928      +5     
  Partials     382     382             
Files with missing lines Coverage Δ
...metric/internal/aggregate/exponential_histogram.go 98.6% <96.1%> (-0.1%) ⬇️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dashpole dashpole marked this pull request as ready for review March 8, 2026 22:13
@dashpole dashpole merged commit 4c89d33 into open-telemetry:main Mar 13, 2026
32 checks passed
@dashpole dashpole deleted the exphist_part_1 branch March 13, 2026 14:38
dashpole added a commit that referenced this pull request Mar 17, 2026
Follows #8025

This is the second PR towards a lockless fast-path for the exponential
histogram aggregation. It replaces use of uint64 with atomic.Uint64. It
does not make buckets concurrent-safe. That will come in future PRs.
This is a refactor to make future PRs easier to review since it has a
large diff, but is relatively simple.

The record and measure calls are still guarded by a lock at this point.

You can see the full set of planned changes in
main...dashpole:opentelemetry-go:lockless_exphist_ai.
The implementation is largely based on
#7535 (which I
implemented by hand), but with help from an AI to break it down into
smaller PRs, and simplify aspects of the design.

Part of #7796
@pellared pellared added this to the v1.43.0 milestone Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants