apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
  name: kube-prometheus-stack-kubelet.rules
  namespace: kube-prometheus-stack
  labels:
    app: kube-prometheus-stack
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/instance: kube-prometheus-stack
    app.kubernetes.io/version: "80.8.0"
    app.kubernetes.io/part-of: kube-prometheus-stack
    chart: kube-prometheus-stack-80.8.0
    release: "kube-prometheus-stack"
    heritage: "Helm"
spec:
  groups:
    - name: kubelet.rules
      rules:
        - expr: |-
            histogram_quantile(
              0.99,
              sum(rate(kubelet_pleg_relist_duration_seconds_bucket{job="kubelet", metrics_path="/metrics"}[5m])) by (cluster, instance, le)
              * on (cluster, instance) group_left (node)
              max by (cluster, instance, node) (kubelet_node_name{job="kubelet", metrics_path="/metrics"})
            )
          labels:
            quantile: '0.99'
          record: node_quantile:kubelet_pleg_relist_duration_seconds:histogram_quantile
        - expr: |-
            histogram_quantile(
              0.9,
              sum(rate(kubelet_pleg_relist_duration_seconds_bucket{job="kubelet", metrics_path="/metrics"}[5m])) by (cluster, instance, le)
              * on (cluster, instance) group_left (node)
              max by (cluster, instance, node) (kubelet_node_name{job="kubelet", metrics_path="/metrics"})
            )
          labels:
            quantile: '0.9'
          record: node_quantile:kubelet_pleg_relist_duration_seconds:histogram_quantile
        - expr: |-
            histogram_quantile(
              0.5,
              sum(rate(kubelet_pleg_relist_duration_seconds_bucket{job="kubelet", metrics_path="/metrics"}[5m])) by (cluster, instance, le)
              * on (cluster, instance) group_left (node)
              max by (cluster, instance, node) (kubelet_node_name{job="kubelet", metrics_path="/metrics"})
            )
          labels:
            quantile: '0.5'
          record: node_quantile:kubelet_pleg_relist_duration_seconds:histogram_quantile
