Skip to content

feat(service): Report peak permits in use for concurrency limiters - #822

Open
lcian wants to merge 11 commits into
mainfrom
lcian/track-limiter-peak-concurrency
Open

lcian wants to merge 11 commits into
mainfrom
lcian/track-limiter-peak-concurrency

Conversation

@lcian

@lcian lcian commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

The in_use gauges of the concurrency limiters reach Datadog as one snapshot per flush interval, so a limiter can reject requests while its graph stays below the limit. Each limiter now tracks the peak permits in use between emissions and reports it as a distribution metric (service.concurrency.in_use_peak, service.concurrency.bulk_in_use_peak and tiered.concurrency.in_use_peak).

We use distributions and not gauges, because the exporter keeps only the last gauge value of each flush interval, while it sends every distribution sample and Datadog computes the true max over any period.

The in-use gauges reach Datadog as one snapshot per flush interval, so a
limiter could reject requests while its graph stayed below the limit.
Each limiter now tracks the peak permits in use between emissions and
reports it as a distribution, whose max is the true peak over any period.
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Changelog Preview

This PR lands in these workspaces:

  • objectstore-server: CalVer
📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features

  • Report peak permits in use for concurrency limiters by lcian in #822

🤖 This preview updates automatically when you update the PR.

@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.11538% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.76%. Comparing base (4724de3) to head (ce4564a).

Files with missing lines Patch % Lines
objectstore-service/src/backend/tiered.rs 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #822      +/-   ##
==========================================
+ Coverage   91.72%   91.76%   +0.03%     
==========================================
  Files         122      122              
  Lines       24679    24866     +187     
==========================================
+ Hits        22637    22818     +181     
- Misses       2042     2048       +6     
Components Coverage Δ
Rust Backend 94.14% <97.11%> (+0.02%) ⬆️
Rust Client 90.69% <ø> (ø)
Python Client 91.75% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

Pass the peak to the emitter callbacks inside the stats structs instead
of as a separate argument.
The previous commit included an unrelated whitespace fix by accident.
Take each stats snapshot in one step, so that a peak is never lower than
the permits in use and never restarts at a stale count. Track a separate
peak for the bulk budget, which rejects bulk operations while execution
permits are free.
Only the emitters read the stats in production, so the separate
read-only path is not needed.
Move the peak-tracking acquisition out of the Peak type, inline its
single-purpose wrapper in the service limiter, and write the expected
stats out in the tests instead of using a helper.
Replace the Peak type and its acquisition function with an atomic per
limiter that the acquire paths raise directly.
@lcian
lcian marked this pull request as ready for review November 24, 2026 13:45
@lcian
lcian requested a review from a team as a code owner November 24, 2026 13:45
@lcian
lcian requested a review from jan-auer November 26, 2026 10:03
@lcian
lcian enabled auto-merge (squash) November 26, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants