GetRateLimitPolicyAnalytics
GET/v1/policy/rate-limit-policies/:id/analytics
GetRateLimitPolicyAnalytics computes a "would-have-limited" analytics preview for a MONITOR-action rate-limit policy (fraser#5446 pass 2, item 4.4 / ADR-036 R2 Option B): for each hour in the lookback window, it sums the policy's audience (the same scope resolution the min-clamp resolver uses -- key / tag / project / system) from the existing usage rollups (usage_hourly_rollups) and reports how many of those hours would have breached the policy's triplet ceiling, had the policy been enforced. This is NOT true shadow-mode enforcement (no per-request evaluation, no sub-hour granularity) -- it is a rollup-derived retrospective estimate, intended to help an operator decide whether flipping a MONITOR policy to BLOCK is safe (see the Flow-1 monitor->active flip, fraser#5448). Rejects a BLOCK-action policy's id with FailedPrecondition: a BLOCK policy is already actually enforced by the min-clamp resolver, so a retrospective "would it have limited" estimate is not meaningful for it.
Request
Responses
- 200
Success