2021-01-18
Note
- Prometheus でAPIサーバの監視【HTTP】 - Carpe Diem
- https://christina04.hatenablog.com/entry/prometheus-application-over-http
- error rate のクエリの書き方が参考になった
sum by(handler, method)(rate(http_requests_total{code=~"4.."}[1m]))
/
sum by(handler, method)(rate(http_requests_total[1m]))
- Query functions | Prometheus
- Prometheus Absent function - Stack Overflow
- https://stackoverflow.com/questions/53191746/prometheus-absent-function
- absent はグルーピングできないので下みたいなのを使うらしい
count(up{job="prometheus"} offset 1h) by (project) unless count(up{job="prometheus"} ) by (project)