# Useful examples on how to configure Prometheus
# * https://www.weave.works/prometheus-and-kubernetes-monitoring-your-applications/
# * https://grafana.net/dashboards/162
apiVersion: v1
kind: ConfigMap
metadata:
  name: prometheus-alertrules
  namespace: monitoring
data:
  alert.rules: |-
    groups:
    - name: HighErrorRate
      rules:
      - alert: HighErrorRate
        expr: rate(request_duration_seconds_count{status_code="500"}[5m]) > 1
        for: 5m
        labels:
          severity: slack
        annotations:
          summary: "High HTTP 500 error rates"
          description: "Rate of HTTP 500 errors per 5 minutes: {{ $value }}"