apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
  name: kube-prometheus-stack-kube-apiserver-histogram.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: "81.0.0"
    app.kubernetes.io/part-of: kube-prometheus-stack
    chart: kube-prometheus-stack-81.0.0
    release: "kube-prometheus-stack"
    heritage: "Helm"
spec:
  groups:
    - name: kube-apiserver-histogram.rules
      rules:
        - expr: histogram_quantile(0.99, sum by (cluster, le, resource) (rate(apiserver_request_sli_duration_seconds_bucket{job="apiserver",verb=~"LIST|GET",subresource!~"proxy|attach|log|exec|portforward"}[5m]))) > 0
          labels:
            quantile: '0.99'
            verb: read
          record: cluster_quantile:apiserver_request_sli_duration_seconds:histogram_quantile
        - expr: histogram_quantile(0.99, sum by (cluster, le, resource) (rate(apiserver_request_sli_duration_seconds_bucket{job="apiserver",verb=~"POST|PUT|PATCH|DELETE",subresource!~"proxy|attach|log|exec|portforward"}[5m]))) > 0
          labels:
            quantile: '0.99'
            verb: write
          record: cluster_quantile:apiserver_request_sli_duration_seconds:histogram_quantile
