Add monitoring stack: Prometheus, Alertmanager, Grafana

This commit is contained in:
rezayaghobi-dev
2026-10-03 19:47:36 +03:30
parent a1973b97ff
commit aa6cd39b8c
7 changed files with 175 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
groups:
- name: webapp
rules:
- alert: WebappDown
expr: up{job="webapp"} == 0
for: 30s
labels:
severity: critical
annotations:
summary: "Webapp is down"
description: "Prometheus cannot scrape the webapp for more than 30 seconds."
- alert: HighErrorRate
expr: sum(rate(http_requests_total{status=~"5.."}[1m])) / sum(rate(http_requests_total[1m])) > 0.05
for: 1m
labels:
severity: warning
annotations:
summary: "More than 5% of requests are failing"
description: "The 5xx ratio has been above 5% for 1 minute."
- alert: HighLatencyP95
expr: histogram_quantile(0.95, sum by (le) (rate(http_request_duration_seconds_bucket[5m]))) > 0.5
for: 2m
labels:
severity: warning
annotations:
summary: "p95 latency above 500ms"
description: "95% of requests take longer than 0.5s."