Module: Labkit::RateLimit::Metrics
- Defined in:
- lib/labkit/rate_limit/metrics.rb
Class Method Summary collapse
-
.calls_total ⇒ Object
Emitted once per matched rule, not once per check: every rule that matches is evaluated, so summing this by rate_limiter counts rule evaluations rather than requests.
- .errors_total ⇒ Object
- .limit_gauge ⇒ Object
- .period_gauge ⇒ Object
Class Method Details
.calls_total ⇒ Object
Emitted once per matched rule, not once per check: every rule that matches is evaluated, so summing this by rate_limiter counts rule evaluations rather than requests. rule="unmatched", action="allow" is emitted only when no rule matched at all.
12 13 14 15 16 17 18 |
# File 'lib/labkit/rate_limit/metrics.rb', line 12 def calls_total Labkit::Metrics::Client.counter( :gitlab_labkit_rate_limiter_calls_total, 'Total number of successful rate limit checks', { rate_limiter: nil, rule: nil, action: nil } ) end |
.errors_total ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/labkit/rate_limit/metrics.rb', line 20 def errors_total Labkit::Metrics::Client.counter( :gitlab_labkit_rate_limiter_errors_total, 'Total number of rate limit check errors', { rate_limiter: nil } ) end |