Skip to content

Commit

Permalink
Fixing query for failed rules
Browse files Browse the repository at this point in the history
Fixing example query to get number for failed requests in 24 hours in default namespace.

Signed-off-by: nileshbhadana <nileshbhadana3@gmail.com>
  • Loading branch information
nileshbhadana committed Dec 6, 2021
1 parent b984b7a commit e5b8e4d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ Counter - An only-increasing integer representing the number of results/executio
## Useful Queries

* Tracking the total number of rules which failed in the 24 hours in "default" namespace grouped by their rule types (validate, mutate, generate):<br>
`sum(increase(kyverno_policy_results_total{policy_namespace="default"}[24h])) by (rule_type)`
`sum(increase(kyverno_policy_results_total{policy_namespace="default", rule_result="fail"}[24h])) by (rule_type)`

* Tracking the per-minute rate of the number of rule executions triggered by incoming Pod requests over the cluster:<br>
`rate(kyverno_policy_results_total{resource_kind="Pod", rule_execution_cause="admission_request"}[1m])*60`

* Tracking the total number of policies over the cluster running as a part of background scans over the last 2 hours:<br>
`count(increase(kyverno_policy_results_total{rule_execution_cause="background_scan"}[2h]) by (policy_name))`
`count(increase(kyverno_policy_results_total{rule_execution_cause="background_scan"}[2h]) by (policy_name))`

0 comments on commit e5b8e4d

Please sign in to comment.