From bee017e561fbfb0ce76683ba5180253ff04c94f9 Mon Sep 17 00:00:00 2001 From: Paul Warner Date: Mon, 27 Apr 2015 17:49:50 -0700 Subject: [PATCH] Add HAProxy timer metrics There are useful to see backend performance. There are new in HAProxy 1.5, see http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#9.1 Change should still work with older HAProxy --- checks.d/haproxy.py | 4 ++++ tests/checks/integration/test_haproxy.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/checks.d/haproxy.py b/checks.d/haproxy.py index d5c99ce8c3..a2f3fcc940 100644 --- a/checks.d/haproxy.py +++ b/checks.d/haproxy.py @@ -59,6 +59,10 @@ def __init__(self, name, init_config, agentConfig, instances=None): "hrsp_4xx": ("rate", "response.4xx"), "hrsp_5xx": ("rate", "response.5xx"), "hrsp_other": ("rate", "response.other"), + "qtime": ("gauge", "queue.time"), # HA Proxy 1.5 and higher + "ctime": ("gauge", "connect.time"), # HA Proxy 1.5 and higher + "rtime": ("gauge", "response.time"), # HA Proxy 1.5 and higher + "ttime": ("gauge", "session.time"), # HA Proxy 1.5 and higher } SERVICE_CHECK_NAME = 'haproxy.backend_up' diff --git a/tests/checks/integration/test_haproxy.py b/tests/checks/integration/test_haproxy.py index 54ed305dbe..afb9f8df24 100644 --- a/tests/checks/integration/test_haproxy.py +++ b/tests/checks/integration/test_haproxy.py @@ -22,6 +22,10 @@ class HaproxyTest(AgentCheckTest): BACKEND_CHECK_GAUGES = [ 'haproxy.backend.queue.current', 'haproxy.backend.session.current', + 'haproxy.backend.queue.time', + 'haproxy.backend.connect.time', + 'haproxy.backend.response.time', + 'haproxy.backend.session.time', ] FRONTEND_CHECK_RATES = [