Cheat Sheet - Prometheus Alerting

Certificate expiration
groups:
- name: ssl-certificate-expiration.rules
  rules:
  - alert: SSLCertExpiresSoon
    expr: probe_ssl_earliest_cert_expiry{job="blackbox"} - time() < 7 * 60 * 60
      * 24
    for: 30m
    labels:
      severity: s1
      pager: pagerduty
    annotations:
      description: Check SSL for specified nodes and consider reissuing certificate.
      runbook: troubleshooting/ssl_cert.md
      summary: SSL certificate for {{ $labels.instance }} expires in {{ $value | humanizeDuration }}