Repository navigation
Conversation
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.
Changelog PreviewThis PR lands in these workspaces:
📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features
🤖 This preview updates automatically when you update the PR. |
Codecov Report❌ Patch coverage is
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
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
marked this pull request as ready for review
November 24, 2026 13:45
jan-auer
reviewed
Nov 24, 2026
lcian
enabled auto-merge (squash)
November 26, 2026 10:09
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.
The
in_usegauges 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_peakandtiered.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
maxover any period.