Generating Policy Execution Latency
This metric can be used to track the latencies associated with the execution/processing of generating policies whenever they evaluate incoming resource requests or execute background scans.
Metric Name(s)
kyverno_generating_policy_execution_duration_seconds_count
kyverno_generating_policy_execution_duration_seconds_sum
kyverno_generating_policy_execution_duration_seconds_bucket
Metric Value
Histogram - A float value representing the latency of the generating policy’s execution in seconds.
See Prometheus docs for a detailed explanation of how histograms work.
Metric Labels
Label | Allowed Values | Description |
---|---|---|
policy_background_mode | “true”, “false” | Policy’s set background mode |
policy_name | Name of the policy | |
resource_kind | “Pod”, “Deployment”, “StatefulSet”, “ReplicaSet”, etc. | Kind of this resource |
resource_namespace | Namespace in which this resource lives | |
resource_request_operation | “create”, “update”, “delete” | If the requested resource is being created, updated, or deleted. |
execution_cause | “admission_request”, “background_scan” | Identifies whether the policy is executing in response to an admission request or a periodic background scan. |
result | “PASS”, “FAIL” | Result of the policy’s execution |
Use cases
- The cluster admin wants to know how efficiently the policies are getting executed by tracking the average latencies associated with the Kyverno policies’ execution since the last 24 hrs.
- The cluster admin wants to track the policy causing highest latency in a certain cluster policy.
Useful Queries
- Tracking the average latency associated with the execution of generating policies:
avg(kyverno_generating_policy_execution_duration_seconds{})
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.