Commit ad0794e0 authored by ale's avatar ale

Drop unnecessary labels from NGINX precomputations

parent 20e1f56c
Pipeline #3382 passed with stage
in 4 minutes and 57 seconds
......@@ -423,7 +423,7 @@
"multi": false,
"name": "vhost",
"options": [],
"query": "label_values(nginx_http_requests, vhost)",
"query": "label_values(global:nginx_http_requests_total:rate5m, vhost)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
......@@ -469,4 +469,4 @@
"title": "HTTP",
"uid": "xCSUMFnmz",
"version": 1
}
\ No newline at end of file
}
groups:
- name: roles/prometheus/files/rules/alerts_nginx.conf
rules:
- alert: HTTPErrorRatioHigh
expr: (global:nginx_http_requests_errs:ratio > 0.02 and global:nginx_http_requests_total:rate5m > 0.1)
for: 5m
......@@ -11,8 +12,9 @@ groups:
annotations:
summary: 'High HTTP error ratio for {{$labels.vhost}} globally'
description: 'We are serving lots of 5xx errors for {{$labels.vhost}} on all frontends.'
- alert: HTTPErrorRatioHigh
expr: (instance:nginx_http_requests_errs:ratio > 0.02 and instance:nginx_http_requests_total:rate5m > 0.1)
expr: (host:nginx_http_requests_errs:ratio > 0.02 and host:nginx_http_requests_total:rate5m > 0.1)
for: 10m
labels:
scope: host
......
groups:
- name: roles/prometheus/files/rules/rules_nginx.conf
rules:
- record: instance:nginx_http_requests_total:rate5m
expr: sum(rate(nginx_http_requests[5m])) without (backend, method, code)
- record: instance:nginx_http_requests_errs:rate5m
expr: sum(rate(nginx_http_requests{code=~"5.*"}[5m])) without (backend, method, code)
- record: instance:nginx_http_requests_errs:ratio
expr: (instance:nginx_http_requests_errs:rate5m / instance:nginx_http_requests_total:rate5m)
- record: host:nginx_http_requests_total:rate5m
expr: sum(rate(nginx_http_requests[5m])) by (host, vhost)
- record: host:nginx_http_requests_errs:rate5m
expr: sum(rate(nginx_http_requests{code=~"5.*"}[5m])) by (host, vhost)
- record: host:nginx_http_requests_errs:ratio
expr: (host:nginx_http_requests_errs:rate5m / host:nginx_http_requests_total:rate5m)
- record: global:nginx_http_requests_total:rate5m
expr: sum(rate(nginx_http_requests[5m])) without (instance, host, exported_instance,
exported_host, backend, method, code)
expr: sum(rate(nginx_http_requests[5m])) by (vhost)
- record: global:nginx_http_requests_errs:rate5m
expr: sum(rate(nginx_http_requests{code=~"5.*"}[5m])) without (instance, host,
exported_instance, exported_host, backend, method, code)
expr: sum(rate(nginx_http_requests{code=~"5.*"}[5m])) by (vhost)
- record: global:nginx_http_requests_errs:ratio
expr: (global:nginx_http_requests_errs:rate5m / global:nginx_http_requests_total:rate5m)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment