summaryrefslogtreecommitdiff
path: root/modules/monitoring/rules/nginx.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'modules/monitoring/rules/nginx.yaml')
-rw-r--r--modules/monitoring/rules/nginx.yaml60
1 files changed, 60 insertions, 0 deletions
diff --git a/modules/monitoring/rules/nginx.yaml b/modules/monitoring/rules/nginx.yaml
new file mode 100644
index 0000000..f00d372
--- /dev/null
+++ b/modules/monitoring/rules/nginx.yaml
@@ -0,0 +1,60 @@
+---
+groups:
+ - name: Nginx
+
+ rules:
+ - alert: NginxHighHttp4xxErrorRate
+ expr: >-
+ sum(rate(nginx_http_requests_total{status=~"^4.."}[1m]))
+ /
+ sum(rate(nginx_http_requests_total[1m])) * 100
+ > 5
+ for: 1m
+ labels:
+ severity: critical
+ annotations:
+ summary: NGINX high HTTP 4xx error rate at {{ $labels.instance }}.
+ description: |-
+ Too many HTTP requests with a 4xx status code.
+
+ VALUE = {{ $value }}
+ LABELS = {{ $labels }}
+
+ - alert: NginxHighHttp5xxErrorRate
+ expr: >-
+ sum(rate(nginx_http_requests_total{status=~"^5.."}[1m]))
+ /
+ sum(rate(nginx_http_requests_total[1m])) * 100
+ > 5
+ for: 1m
+ labels:
+ severity: critical
+ annotations:
+ summary: NGINX high HTTP 5xx error rate at {{ $labels.instance }}.
+ description: |-
+ Too many HTTP requests with a 5xx status code.
+
+ VALUE = {{ $value }}
+ LABELS = {{ $labels }}
+
+ - alert: NginxLatencyHigh
+ expr: >-
+ histogram_quantile(
+ 0.99,
+ sum(
+ rate(
+ nginx_http_request_duration_seconds_bucket[2m]
+ )
+ ) by (host, node)
+ )
+ > 3
+ for: 2m
+ labels:
+ severity: warning
+ annotations:
+ summary: NGINX high latency at {{ $labels.instance }}.
+ description: |-
+ NGINX 99% of latency spikes is higher than 3 seconds.
+
+ VALUE = {{ $value }}
+ LABELS = {{ $labels }}