diff options
author | Azat Bahawi <azat@bahawi.net> | 2023-04-12 04:01:46 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2023-04-12 04:01:46 +0300 |
commit | d6368c86bc949371e904eed3d0a6583ebd53b055 (patch) | |
tree | 042db513412ba7f1577b1ac690d4e0e0fac22cbf /modules/nixos/monitoring/rules/nginx.yaml | |
parent | 2023-04-07 (diff) |
2023-04-12
Diffstat (limited to '')
-rw-r--r-- | modules/nixos/monitoring/rules/nginx.yaml | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/modules/nixos/monitoring/rules/nginx.yaml b/modules/nixos/monitoring/rules/nginx.yaml index 59229a8..f00d372 100644 --- a/modules/nixos/monitoring/rules/nginx.yaml +++ b/modules/nixos/monitoring/rules/nginx.yaml @@ -6,47 +6,55 @@ groups: - alert: NginxHighHttp4xxErrorRate expr: >- sum(rate(nginx_http_requests_total{status=~"^4.."}[1m])) - / sum(rate(nginx_http_requests_total[1m])) * 100 + / + sum(rate(nginx_http_requests_total[1m])) * 100 > 5 for: 1m labels: severity: critical annotations: - summary: NGINX high HTTP 4xx error rate (instance {{ $labels.instance }}) + summary: NGINX high HTTP 4xx error rate at {{ $labels.instance }}. description: |- - Too many HTTP requests with status 4xx (> 5%). + Too many HTTP requests with a 4xx status code. - VALUE = {{ $value }} - LABELS = {{ $labels }} + VALUE = {{ $value }} + LABELS = {{ $labels }} - alert: NginxHighHttp5xxErrorRate expr: >- sum(rate(nginx_http_requests_total{status=~"^5.."}[1m])) - / sum(rate(nginx_http_requests_total[1m])) * 100 + / + sum(rate(nginx_http_requests_total[1m])) * 100 > 5 for: 1m labels: severity: critical annotations: - summary: NGINX high HTTP 5xx error rate (instance {{ $labels.instance }}) + summary: NGINX high HTTP 5xx error rate at {{ $labels.instance }}. description: |- - Too many HTTP requests with status 5xx (> 5%). + Too many HTTP requests with a 5xx status code. - VALUE = {{ $value }} - LABELS = {{ $labels }} + VALUE = {{ $value }} + LABELS = {{ $labels }} - alert: NginxLatencyHigh expr: >- - histogram_quantile(0.99, - sum(rate(nginx_http_request_duration_seconds_bucket[2m])) by (host, node)) + 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 (instance {{ $labels.instance }}) + summary: NGINX high latency at {{ $labels.instance }}. description: |- - NGINX 99% latency is higher than 3 seconds. + NGINX 99% of latency spikes is higher than 3 seconds. - VALUE = {{ $value }} - LABELS = {{ $labels }} + VALUE = {{ $value }} + LABELS = {{ $labels }} |