Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions src/content/docs/docs/guides/monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Disabling select metrics with [DataDog OpenMetrics](https://docs.datadoghq.com/i
- [`kyverno_policy_rule_info_total`](/docs/reference/metrics#policies-and-rules-count) - Policies and Rules Count
- [`kyverno_admission_requests`](/docs/reference/metrics#admission-requests-count) - Admission Requests Count
- [`kyverno_policy_changes`](/docs/reference/metrics#policy-changes-count) - Policy Changes Count
- [`kyverno_policy_results`](/docs/reference/metrics#policy-and-rule-execution) - Policy and Rule Execution
- [`kyverno_policy_results_total`](/docs/reference/metrics#policy-and-rule-execution) - Policy and Rule Execution

```yaml
apiVersion: v1
Expand All @@ -203,17 +203,12 @@ metadata:
"exclude_labels": [
"resource_namespace"
]
},
},
{
"openmetrics_endpoint": "http://%%host%%:8000/metrics",
"namespace": "kyverno",
"metrics": [
{"kyverno_policy_results": "policy_results"}
]
}
]
}
}
{"kyverno_policy_results_total": "policy_results"}
Copy link

Copilot AI Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The YAML example appears to be incomplete. The metrics array starting at line 210 is missing its closing brackets and the containing JSON objects are missing their closing braces. This should include the closing for the metrics array (]), the instance object (}), the instances array (]), and the openmetrics object (}).

Based on the second example later in the file (lines 223-251), the complete structure should look like:

            "metrics": [
              {"kyverno_policy_results_total": "policy_results"}
            ]
          }
        ]
      }
    }
Suggested change
{"kyverno_policy_results_total": "policy_results"}
{"kyverno_policy_results_total": "policy_results"}
]
}
]
}
}

Copilot uses AI. Check for mistakes.
```

The Kyverno Helm chart supports including additional Pod annotations in the values file as shown in the below example.
Expand All @@ -223,7 +218,7 @@ The Kyverno Helm chart supports including additional Pod annotations in the valu
- [`kyverno_policy_rule_info_total`](/docs/reference/metrics#policies-and-rules-count) - Policies and Rules Count
- [`kyverno_admission_requests`](/docs/reference/metrics#admission-requests-count) - Admission Requests Count
- [`kyverno_policy_changes`](/docs/reference/metrics#policy-changes-count) - Policy Changes Count
- [`kyverno_policy_results`](/docs/reference/metrics#policy-and-rule-execution) - Policy and Rule Execution
- [`kyverno_policy_results_total`](/docs/reference/metrics#policy-and-rule-execution) - Policy and Rule Execution

```yaml
podAnnotations:
Expand All @@ -250,7 +245,7 @@ podAnnotations:
"openmetrics_endpoint": "http://%%host%%:8000/metrics",
"namespace": "kyverno",
"metrics": [
{"kyverno_policy_results": "policy_results"}
{"kyverno_policy_results_total": "policy_results"}
]
}
]
Expand Down
8 changes: 4 additions & 4 deletions src/content/docs/docs/reference/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Gauge - `1` for rules currently actively present in the cluster.

#### Metric Name(s)

- `kyverno_policy_results`
- `kyverno_policy_results_total`

#### Metric Value

Expand Down Expand Up @@ -95,13 +95,13 @@ 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{policy_namespace="default", rule_result="fail"}[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{resource_kind="Pod", rule_execution_cause="admission_request"}[1m])*60`
`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{rule_execution_cause="background_scan"}[2h]) by (policy_name))`
`count(increase(kyverno_policy_results_total{rule_execution_cause="background_scan"}[2h]) by (policy_name))`

---

Expand Down