- name: Http
  rules:
    - alert: NginxDown
      expr: >
        nginx_up{job="nginx"} == 0
      for: 10m
      labels:
        severity: critical
      annotations:
        summary: "Nginx on {{ $labels.instance }} is down"
    - alert: HighHttpErrorRate
      expr: >
        sum by(vhost, instance) (rate(http_response_count_total{status=~"5..",job="nginxlog"}[1m])) /
        sum by(vhost, instance) (rate(http_response_count_total{job="nginxlog"}[1m]))
        > 0
      for: 30m
      labels:
        severity: critical
      annotations:
        summary: "Nginx VHost {{ $labels.vhost }} on {{ $labels.instance }} is generating many internal server errors over 1 hour"
