monitoring/rules/http_healthcheck.yaml

32 lines
982 B
YAML

groups:
- name: website
rules:
- alert: WebsiteStatus
expr:
probe_http_status_code >= 500
for: 5m
labels:
severity: critical
annotations:
summary: Website experienced a lot of 5xx
description: "{{ $labels.instance }} has been serving {{ $value }} errors for the past 5m"
- alert: WebsiteConnectivity
expr:
probe_http_status_code == 0
for: 5m
labels:
severity: critical
annotations:
summary: Website connectivity problem
description: The probe has been unable to connect to {{ $labels.instance }} for the past 5m.
- alert: CertificateExpiration
expr: ((probe_ssl_earliest_cert_expiry{instance=~"https://.*"} - time()) / 86400) < 7
for: 5m
labels:
severity: warning
annotations:
summary: Certificate will expire soon
description: The certicate at {{ $labels.instance }} will expire in {{ $value }} days.