Skip to main content
APA
Sponsored byCAST AI — Kubernetes cost optimizationBetter Stack — Uptime monitoring and log managementVictoriaMetrics — Fast, open-source time series database and drop-in Prometheus replacement.

Kyverno logoKyverno Prometheus Alert Rules

6 Prometheus alerting rules for Kyverno.Exported via Embedded exporter.These rules cover critical and warning conditions — copy and paste the YAML into your Prometheus configuration.

⚠️

Alert thresholds depend on the nature of your applications. Some queries may have arbitrary tolerance thresholds. Building an efficient monitoring platform takes time. 😉

9.10.Kyverno logoEmbedded exporter(6 rules)

Scrape the metrics port (8000 by default) of the admission, background, cleanup and reports controllers.
Kyverno exports its metrics through OpenTelemetry, so counters get the `_total` suffix.
wget https://raw.githubusercontent.com/samber/awesome-prometheus-alerts/refs/heads/master/dist/rules/kyverno/embedded-exporter.yml
warning

9.10.1.Kyverno admission review slow (p99 > 1s)

99th percentile of the Kyverno admission review latency on {{ $labels.instance }} is {{ $value | humanizeDuration }}. Every API request matched by a policy waits for it, and the API server gives up on the webhook at its timeout (10s by default).

  # Threshold of 1s is arbitrary. Adjust it to your workload.
- alert: KyvernoAdmissionReviewSlow(p99>1s)
  expr: 'histogram_quantile(0.99, sum by (instance, le) (rate(kyverno_admission_review_duration_seconds_bucket[5m]))) > 1'
  for: 10m
  labels:
    severity: warning
  annotations:
    summary: Kyverno admission review slow (p99 > 1s) (instance {{ $labels.instance }})
    description: "99th percentile of the Kyverno admission review latency on {{ $labels.instance }} is {{ $value | humanizeDuration }}. Every API request matched by a policy waits for it, and the API server gives up on the webhook at its timeout (10s by default).\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

9.10.2.Kyverno controller dropping work

Kyverno controller {{ $labels.controller_name }} on {{ $labels.instance }} dropped {{ $value | printf "%.0f" }} item(s) from its queue after exhausting its retries. Those resources are not reconciled until they change again.

- alert: KyvernoControllerDroppingWork
  expr: 'sum by (instance, controller_name) (increase(kyverno_controller_drop_total[5m])) > 0'
  for: 0m
  labels:
    severity: warning
  annotations:
    summary: Kyverno controller dropping work (instance {{ $labels.instance }})
    description: "Kyverno controller {{ $labels.controller_name }} on {{ $labels.instance }} dropped {{ $value | printf \"%.0f\" }} item(s) from its queue after exhausting its retries. Those resources are not reconciled until they change again.\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

9.10.3.Kyverno admission reports dropped

Kyverno on {{ $labels.instance }} skipped {{ $value | printf "%.0f" }} admission report(s) because the {{ $labels.circuit_name }} circuit breaker is open. There are more ephemeral reports than --maxAdmissionReports allows, so policy reports miss admission results.

- alert: KyvernoAdmissionReportsDropped
  expr: 'sum by (instance, circuit_name) (increase(kyverno_breaker_drops_total[5m])) > 0'
  for: 0m
  labels:
    severity: warning
  annotations:
    summary: Kyverno admission reports dropped (instance {{ $labels.instance }})
    description: "Kyverno on {{ $labels.instance }} skipped {{ $value | printf \"%.0f\" }} admission report(s) because the {{ $labels.circuit_name }} circuit breaker is open. There are more ephemeral reports than --maxAdmissionReports allows, so policy reports miss admission results.\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

9.10.4.Kyverno cleanup policy failures

Kyverno failed to delete {{ $value | printf "%.0f" }} {{ $labels.resource }} object(s) matched by {{ $labels.policy_type }} {{ $labels.policy_name }} in the last 5 minutes.

- alert: KyvernoCleanupPolicyFailures
  expr: 'sum by (instance, policy_type, policy_namespace, policy_name, resource) (increase(kyverno_deleting_controller_errors_total[5m])) > 0'
  for: 0m
  labels:
    severity: warning
  annotations:
    summary: Kyverno cleanup policy failures (instance {{ $labels.instance }})
    description: "Kyverno failed to delete {{ $value | printf \"%.0f\" }} {{ $labels.resource }} object(s) matched by {{ $labels.policy_type }} {{ $labels.policy_name }} in the last 5 minutes.\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

9.10.5.Kyverno TTL cleanup failures

Kyverno failed to delete {{ $value | printf "%.0f" }} {{ $labels.resource_resource }} object(s) labeled with cleanup.kyverno.io/ttl in the last 5 minutes.

- alert: KyvernoTtlCleanupFailures
  expr: 'sum by (instance, resource_group, resource_version, resource_resource) (increase(kyverno_ttl_controller_errors_total[5m])) > 0'
  for: 0m
  labels:
    severity: warning
  annotations:
    summary: Kyverno TTL cleanup failures (instance {{ $labels.instance }})
    description: "Kyverno failed to delete {{ $value | printf \"%.0f\" }} {{ $labels.resource_resource }} object(s) labeled with cleanup.kyverno.io/ttl in the last 5 minutes.\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
info

9.10.6.Kyverno events dropped

Kyverno on {{ $labels.instance }} dropped {{ $value | printf "%.0f" }} Kubernetes event(s) in the last 5 minutes. Policy violations and rule results are missing from the cluster events.

- alert: KyvernoEventsDropped
  expr: 'increase(kyverno_events_dropped_total[5m]) > 0'
  for: 0m
  labels:
    severity: info
  annotations:
    summary: Kyverno events dropped (instance {{ $labels.instance }})
    description: "Kyverno on {{ $labels.instance }} dropped {{ $value | printf \"%.0f\" }} Kubernetes event(s) in the last 5 minutes. Policy violations and rule results are missing from the cluster events.\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"

Share your alerting rules

Your production alerts can make this collection better. Share your rule files in one command: only Prometheus rule files and PrometheusRule resources are uploaded, while prometheus.yml, alertmanager.yml and other configurations are skipped, as they often contain credentials.

npx awesome-prometheus-alerts share /etc/prometheus/rules

Add --dry-run to preview what would be sent.