Fix HaproxyBackendMaxActiveSession: look at current / limit (#413)

haproxy_backend_max_sessions is the maximum number of sessions ever encountered during the lifetime of the HAProxy process. That is, it will never go down until HAProxy is restarted, so the alert continues to fire even though the situation has cleared!

This doesn't make sense. Look at the currently active sessions instead.
This commit is contained in:
Florian Schlichting 2024-05-13 12:09:04 +02:00 committed by GitHub
parent 613401a960
commit 396083a2a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1785,7 +1785,7 @@ groups:
severity: critical
- name: HAProxy backend max active session
description: HAproxy backend {{ $labels.fqdn }}/{{ $labels.backend }} is reaching session limit (> 80%).
query: "((sum by (backend) (avg_over_time(haproxy_backend_max_sessions[2m]) * 100) / sum by (backend) (avg_over_time(haproxy_backend_limit_sessions[2m])))) > 80"
query: "((sum by (backend) (avg_over_time(haproxy_backend_current_sessions[2m]) * 100) / sum by (backend) (avg_over_time(haproxy_backend_limit_sessions[2m])))) > 80"
severity: warning
for: 2m
- name: HAProxy pending requests