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

     1  {
     2    prometheusAlerts+:: {
     3      local componentName = $._config.components.hook,
     4      groups+: [
     5        {
     6          name: 'abnormal webhook behaviors',
     7          rules: [
     8            {
     9              alert: 'no-webhook-calls',
    10              // Monday-Friday 9:00-17:00 PDT = (7 hours different) 16:00-24:00  (in UTC)
    11              expr: |||
    12                (sum(increase(prow_webhook_counter[1m])) == 0 or absent(prow_webhook_counter))
    13                and ((day_of_week() > 0) and (day_of_week() < 6) and (hour() >= 16))
    14              |||,
    15              'for': $._config.webhookMissingAlertInterval,
    16              labels: {
    17                severity: 'high',
    18                slo: componentName,
    19              },
    20              annotations: {
    21                message: 'There have been no webhook calls on working hours for %s' % $._config.webhookMissingAlertInterval,
    22              },
    23            },
    24          ],
    25        },
    26      ],
    27    },
    28  }