Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Metric gubernator_getratelimit_counter adds calltype value "local n…
Browse files Browse the repository at this point in the history
…on-owner"

Better tracks the code path.
Can exclude non-owner activity.
Can get accurate total rate limit checks with query like `rate(gubernator_getratelimit_counter{calltype="local"}[1m])`
  • Loading branch information
Baliedge committed Mar 11, 2024
1 parent c0608d5 commit 517bf63
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gubernator.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,11 @@ func (s *V1Instance) getLocalRateLimit(ctx context.Context, r *RateLimitReq, rs
s.global.QueueUpdate(r)
}

metricGetRateLimitCounter.WithLabelValues("local").Inc()
if rs.IsOwner {
metricGetRateLimitCounter.WithLabelValues("local").Inc()
} else {
metricGetRateLimitCounter.WithLabelValues("local non-owner").Inc()
}
return resp, nil
}

Expand Down

0 comments on commit 517bf63

Please sign in to comment.