diff --git a/prometheus-data/alert.rules b/prometheus-data/alert.rules index 3ab6b18..41f4131 100644 --- a/prometheus-data/alert.rules +++ b/prometheus-data/alert.rules @@ -1,8 +1,10 @@ # APIHighMedianResponseTime -ALERT APIHighMedianResponseTime - IF histogram_quantile(0.5, sum(rate(http_request_duration_ms_bucket[1m])) by (le, service, route, method)) > 100 - FOR 60s - ANNOTATIONS { - summary = "High median response time on {{ $labels.service }} and {{ $labels.method }} {{ $labels.route }}", - description = "{{ $labels.service }}, {{ $labels.method }} {{ $labels.route }} has a median response time above 100ms (current value: {{ $value }}ms)", - } +groups: +- name: PM2 Alert + rules: + - alert: APIHighMedianResponseTime + expr: histogram_quantile(0.5, sum(rate(http_request_duration_ms_bucket[1m])) by (le, service, route, method)) > 100 + for: 60s + annotations: + summary: "High median response time on {{ $labels.service }} and {{ $labels.method }} {{ $labels.route }}" + description: "{{ $labels.service }}, {{ $labels.method }} {{ $labels.route }} has a median response time above 100ms (current value: {{ $value }}ms)"