This extension documentation is now deprecated and will no longer be updated. We recommend using the new HAProxy extension for improved functionality and support.
HAProxy is a commonly used load-balancer and proxy for TCP and HTTP-based applications that is considered to be fast, reliable, and well-suited for high-traffic websites. We support socket mode and HTTP monitoring mode.
We recommend socket mode rather than HTTP mode.
HAProxy socket mode monitoring supports global (applicable to all hosts) and local (applicable to specific hosts only) configuration.
Supported HAProxy/HAPEE version for socket mode
This support includes HAProxy Enterprise Edition (HAPEE)
Dynatrace OneAgent version 1.113+
Dynatrace User (dtuser
) with read privileges in the HAProxy configuration file
Dynatrace User (dtuser
) with read/write privileges in stats sockets
Stats socket located in a directory in which Dynatrace User (dtuser
) has execute
permissions
Important: one socket for each running process
Sample code for an HAProxy configuration file:
globalstats socket /var/run/haproxy/process1.sock mode 600 level operator process 1 user dtuserstats socket /var/run/haproxy/process2.sock mode 600 level operator process 2 user dtuserstats timeout 30snbproc 2
From OneAgent version 1.165, you can use #DYNATRACE.SKIP
in the HAProxy configuration file to mark sockets used for administration that you want Dynatrace to ignore. Dynatrace will not use the line following #DYNATRACE.SKIP
. In this example, admin.sock
will not be used to gather statistics.
globalstats socket /var/run/haproxy/process1.sock mode 600 level operator process 1 user dtuserstats socket /var/run/haproxy/process2.sock mode 600 level operator process 2 user dtuser#DYNATRACE.SKIPstats socket /var/run/haproxy/admin.sock mode 660 level adminstats timeout 30snbproc 2
Leave User, Password, and URL empty or select the Use socket mode check box.
After you turn HAProxy monitoring on globally, Dynatrace automatically activates HAProxy monitoring on all hosts and monitors all HAProxy components. When a new host running HAProxy is detected in the future, monitoring will be activated and metrics will be gathered automatically.
If you previously turned HAProxy global monitoring on, you must turn global monitoring off before you turn monitoring on per host. Navigate to Settings > Monitored technologies, find the HAProxy entry, and set the Global monitoring switch for HAProxy to the Off position.
To activate socket-mode monitoring per host:
Leave User, Password, and URL empty or select the Use socket mode checkbox.
After you turn HAProxy monitoring on for a host, Dynatrace automatically activates HAProxy monitoring on that host and monitors all HAProxy components on it.
HAProxy HTTP mode monitoring supports global (applicable to all hosts) and local (applicable to specific hosts only) configuration.
http://localhost:1936/haproxy?stats
) or simply enter a URI prefix.After you turn HAProxy monitoring on globally, Dynatrace automatically activates HAProxy monitoring on all hosts and monitors all HAProxy components. When a new host running HAProxy is detected in the future, monitoring will be activated and metrics will be gathered automatically.
If you previously turned HAProxy global monitoring on, you must turn global monitoring off before you turn monitoring on per host. Navigate to Settings > Monitored technologies, find the HAProxy entry, and set the Global monitoring switch for HAProxy to the Off position.
To activate HTTP-mode monitoring per host:
http://localhost:1936/haproxy?stats
) or simply enter a URI prefix.After you turn HAProxy monitoring on for a host, Dynatrace automatically activates HAProxy monitoring on that host and monitors all HAProxy components on it.
Extension events listed on Settings > Anomaly detection > Extension events page.
Dynatrace supports HAProxy running inside Docker containers with the following requirements:
docker run haproxy -p 1936:1936
docker run haproxy
HAProxy metrics captured by the HAProxy monitoring plugin are displayed on all HAProxy process pages. Click into the infographic or click the HAProxy metrics and Further details tabs to view all available metrics.
Metric
Frontend?
Backend?
Description
Requests
x
HTTP requests per second.
Current sessions
x
x
Number of sessions created per second.
Request errors
x
Some possible causes:
Queued requests
x
The current number of queued requests. For the backend, this is the number of requests queued with no server assigned.
Connection errors
x
The number of requests that encountered an error trying to connect to a backend server. This is the sum of the statistic for all servers for that backend, plus any connection errors not associated with a particular server (such as the backend having no servers).
Response errors
x
Response errors include:
Bytes received
x
x
The average incoming bytes per second.
Bytes transmitted
x
x
The average outgoing bytes per second.