Capture HAProxy activity in Datadog to:
- Visualize HAProxy load-balancing performance.
- Know when a server goes down.
- Correlate the performance of HAProxy with the rest of your applications.
The HAProxy check is packaged with the Agent. To start gathering your HAProxy metrics and logs, you need to:
- Install the Agent on your HAProxy servers.
- Make sure that stats are enabled on your HAProxy configuration. Read our blog post on collecting HAProxy metrics for more information.
Edit the haproxy.d/conf.yaml
file, in the conf.d/
folder at the root of your Agent's configuration directory to start collecting your HAProxy metrics and logs.
See the sample haproxy.d/conf.yaml for all available configuration options.
The Agent collects metrics via a stats endpoint:
- Configure one in your
haproxy.conf
:
listen stats # Define a listen section called "stats"
bind :9000 # Listen on localhost:9000
mode http
stats enable # Enable stats page
stats hide-version # Hide HAProxy version
stats realm Haproxy\ Statistics # Title text for popup window
stats uri /haproxy_stats # Stats URI
stats auth Username:Password # Authentication credentials
Add this configuration block to your haproxy.d/conf.yaml
file to start gathering your Haproxy Metrics:
init_config:
instances:
- url: https://localhost:9000/haproxy_stats
username: <your_username>
password: <your_password>
See the sample haproxy.yaml for all available configuration options.
Available for Agent >6.0
-
Collecting logs is disabled by default in the Datadog Agent, you need to enable it in
datadog.yaml
:logs_enabled: true
-
Add this configuration block to your
haproxy.d/conf.yaml
file to start collecting your Haproxy Logs:logs: - type: udp port: 514 service: haproxy source: haproxy sourcecategory: http_web_access
Change the
service
parameter value and configure it for your environment. See the sample haproxy.d/conf.yaml for all available configuration options.
Learn more about log collection in the log documentation
Run the Agent's status
subcommand and look for haproxy
under the Checks section.
See metadata.csv for a list of metrics provided by this integration.
The Haproxy check does not include any events.
haproxy.backend_up
Converts the HAProxy status page into service checks.
Returns CRITICAL
for a given service if HAProxy is reporting it down
.
Returns OK
for maint
, ok
and any other state.
Need help? Contact Datadog support.