k8s.io/test-infra@v0.0.0-20240520184403-27c6b4c223d8/config/prow/cluster/monitoring/mixins/prometheus/boskos_alerts.libsonnet (about)

     1  {
     2    prometheusAlerts+:: {
     3      groups+: [
     4        {
     5          name: 'Boskos resource usage',
     6          rules: [
     7            {
     8              alert: 'Resource exhausted (0% free)',
     9              // This expression evaluates to true iff there is resource type with 0 'free' resources.
    10              // Resource pools with <= 5 resources are ignored since it is often expected for
    11              // small pools to use 100% capacity.
    12              expr: |||
    13                (
    14                  min(boskos_resources{state="free"}) by (type, instance)
    15                  and
    16                  (sum(boskos_resources) by (type, instance) > 5)
    17                ) == 0
    18              |||,
    19              labels: {
    20                severity: 'high',
    21                'boskos_type': '{{ $labels.type }}',
    22              },
    23              annotations: {
    24                message: 'The Boskos resource "{{ $labels.type }}" has been exhausted (currently 0%% free). See the %s.' % [$._config.instance.monitoringLink('/d/wSrfvNxWz/boskos-resource-usage?orgId=1', 'Boskos resource usage dashboard')],
    25              },
    26            },
    27          ],
    28        },
    29      ],
    30    },
    31  }