Our HAProxy integration collects and sends inventory and metrics from your HAProxy instance to the New Relic platform, where you can aggregate and visualize key performance metrics for the HAProxy server, frontends, and backends.
Read on to install the integration, and to see what data we collect.
Compatibility and requirements
Our integration is compatible with HAProxy versions 1.3 - 2.2.
Before installing the integration, make sure that you meet the following requirements:
- HAProxy statistics page is enabled and accessible.
- If HAProxy is not running on Kubernetes or Amazon ECS, you must install the infrastructure agent on a host running HAProxy. Otherwise:
- If running on Kubernetes, see these requirements.
- If running on ECS, see these requirements.
Quick start
Instrument your HAProxy instance quickly and send your telemetry data with guided install. Our guided install creates a customized CLI command for your environment that downloads and installs the New Relic CLI and the infrastructure agent.
Tip
Try our guided install for yourself. (If you're hosted in the EU, use our EU guided install.)
Install and activate
To install the HAProxy integration, follow the instructions for your environment:
Additional notes:
- Advanced: Integrations are also available in tarball format to allow for install outside of a package manager.
- On-host integrations do not automatically update. For best results, regularly update the integration package and the infrastructure agent.
Configure
An integration's YAML-format configuration is where you can place required login credentials and configure how data is collected. Which options you change depend on your setup and preference.
There are several ways to configure the integration, depending on how it was installed:
- If enabled via Kubernetes: see Monitor services running on Kubernetes.
- If enabled via Amazon ECS: see Monitor services running on ECS.
- If installed on-host: edit the config in the integration's YAML config file,
haproxy-config.yml
.
For an example configuration, see the example config file.
Important
With secrets management, you can configure on-host integrations with New Relic infrastructure's agent to use sensitive data (such as passwords) without having to write them as plain text into the integration's configuration file. For more information, see Secrets management.
Commands
The configuration accepts these commands:
all_data
: collects both inventory and metrics for the HAProxy instance.inventory
: collects only the inventory (configuration) data for the HAProxy instance.metrics
: collects only the metrics data for the HAProxy instance.
Arguments
The config commands accept the following arguments:
username
: The username for the HAProxy connection.password
: The password for the HAProxy connection.stats_url
: A URL pointing to the stats page for HAProxy.cluster_name
: A user-defined name to uniquely identify the cluster being monitored. Required.
Example configuration
Example haproxy-config.yml
file configuration:
For more about the general structure of on-host integration configuration, see Configuration.
Find and use data
This integration's data is reported to a dedicated New Relic dashboard.
Metrics are attached to the following event types:
HAProxyBackendSample
HAProxyFrontendSample
HAProxyServerSample
You can query this data for troubleshooting purposes or to create custom charts and dashboards.
For more on how to find and use your data, see Understand integration data.
Metric data
The HAProxy integration collects the following metric data attributes. Each metric name is prefixed with a category indicator and a period, such as backend.
, frontend.
, or server.
.
HAProxy backend sample metrics
These attributes are attached to the HAProxyBackendSample
event type:
Metric | Description |
---|---|
| Number of active servers. |
| Average connect time over the 1024 last requests, in milliseconds. |
| Average queue time over the 1024 last requests, in milliseconds. |
| Average response time over the 1024 last requests, in milliseconds. |
| Average total session time over the 1024 last requests, in milliseconds. |
| Number of backup servers. |
| Bytes received per second. |
| Bytes sent per second. |
| Number of bytes that bypassed the HTTP compressor per second. |
| Number of requests that encountered an error trying to connect to a backend server per second. |
| Number of times a connection to a server was retried per second. |
| The name of the cookie. |
| Current queued requests without a server assigned. |
| Number of current sessions. |
| Number of data transfers aborted by the client per second. |
| Number of data transfers aborted by the server per second. |
| Total downtime in seconds. |
| HTTP responses with 1xx code per second. |
| HTTP responses with 2xx code per second. |
| HTTP responses with 3xx code per second. |
| HTTP responses with 4xx code per second. |
| HTTP responses with 5xx code per second. |
| HTTP responses with other codes (protocol error) per second. |
| HTTP requests per second. |
| Number of HTTP response bytes emitted by the compressor per second. |
| Number of HTTP response bytes fed to the compressor per second. |
| Number of HTTP responses that were compressed per second. |
| Intercepted requests per second. |
| Maximum queued requests without a server assigned. |
| Maximum number of sessions. |
| Maximum number of new sessions per second. |
| The proxy mode. Options: tcp, http, health, unknown. |
| The name of the proxy. |
| Number of times a request was redispatched to another server per second. |
| Requests denied bytcp-request connection rules per second. |
| Response errors per second. |
| Requests denied bytcp-request session rules per second. |
| Number of times a server was selected per second, either for new sessions, or when re-dispatching. |
| Sessions created per second. |
| Status. Options: UP, DOWN, NOLB, MAINT, MAINT(via), MAINT(resolution). |
| Number of seconds since last session assigned to backend. |
| Number of seconds since the last UP<->DOWN transition. |
| Total weight of the backend. |
| Type of backend. |
| Number of UP->DOWN transitions per second. |
HAProxy frontend sample metrics
These attributes are attached to the HAProxyFrontendSample
event type:
Metric | Description |
---|---|
| Number of bytes received per second. |
| Number of bytes sent per second. |
| Number of connections per second. |
| Number of current sessions. |
| HTTP responses with 1xx code per second. |
| HTTP responses with 2xx code per second. |
| HTTP responses with 3xx code per second. |
| HTTP responses with 4xx code per second. |
| HTTP responses with 5xx code per second. |
| HTTP responses with other codes (protocol error). |
| Max number of HTTP requests per second observed. |
| HTTP requests per second. |
| Intercepted requests per second. |
| Maximum number of connections. |
| Maximum number of sessions. |
| Maximum number of new sessions per second. |
| Proxy mode. One of tcp, http, health, unknown. |
| The name of the proxy. |
| Request errors per second. |
| Requests denied because of security concerns per second. |
| Requests denied bytcp-request connection rules per second. |
| Requests denied bytcp-request session rules per second. |
| Responses denied because of security concerns per second. |
| The name of the service. |
| Sessions created per second. |
| The status of the frontend. Options: UP, DOWN, NOLB, MAINT, MAINT(via), MAINT(resolution). |
| Type of frontend. |
HAProxy server sample metrics
These attributes are attached to the HAProxyServerSample
event type:
Metric | Description |
---|---|
| Last agent check contents or textual error. |
| Time taken to finish last check, in milliseconds. |
| Status of the agent. |
| Short human-readable description of |
| Average connect time over the 1024 last requests, in milliseconds. |
| Average queue time over the 1024 last requests, in milliseconds. |
| Average response time over the 1024 last requests, in milliseconds. |
| Average total session time over the 1024 last requests, in milliseconds. |
| Bytes received per second. |
| Bytes sent per second. |
| Short human-readable description of |
| Number of requests that encountered an error trying to connect to a backend server per second. |
| Number of times a connection to a server was retried per second. |
| Server's cookie value. |
| Number of current sessions. |
| Number of data transfers aborted by the client per second. |
| Number of data transfers aborted by the server per second. |
| Total downtime in seconds. |
| Number of failed checks per second. |
| Failed health check details. |
| Last health check contents or textual error. |
| Time it took to finish the last health check, in milliseconds. |
| Health check status. |
| HTTP responses with 1xx code per second. |
| HTTP responses with 2xx code per second. |
| HTTP responses with 3xx code per second. |
| HTTP responses with 4xx code per second. |
| HTTP responses with 5xx code per second. |
| HTTP responses with other codes (protocol error). |
| Whether the server is active. |
| Whether the server is a backup. |
| Layer 5-7 code, if available. |
| Maximum queued requests. |
| Number of maximum sessions. |
| Max sessions per second. |
| Proxy mode. One of tcp, http, health, unknown. |
| The name of the proxy. |
| Current queued requests. |
| Number of times a request was redispatched to another server per second. |
| Requests denied because of security concerns per second. |
| Response errors per second. |
| Responses denied because of security concerns per second. |
| The server ID. |
| Number of times a server was selected per second, either for new sessions, or when re-dispatching. |
| The server weight. |
| The name of the service. |
| Sessions per second. |
| The status of the server. Options: UP, DOWN, NOLB, MAINT, MAINT(via), MAINT(resolution). |
| Throttle percentage for the server, when slowstart is active. Or no value if not in slowstart. |
| Number of seconds since last session assigned to backend. |
| Number of seconds since the last UP<->DOWN transition. |
| The type of server. |
| Number of UP->DOWN transitions per second. |
Inventory data
The HAProxy integration captures the configuration parameters of the HAProxy instance. The data is available on the infrastructure Inventory page, under the config/haproxy source. For more about inventory data, see Understand integration data.
The integration captures data for the following configuration parameters:
Backend inventory
Name | Description |
---|---|
| The backend proxy ID. |
| The backend process ID. |
| The backend session limit. |
Frontend inventory
Name | Description |
---|---|
| The frontend proxy ID. |
| The frontend process ID. |
| New session per second limit. |
| The frontend session limit. |
Server inventory
Name | Description |
---|---|
| The backend proxy ID. |
| The server process ID. |
| The configured max queue. |
| The server ID. |
| The server session limit. |
Check the source code
This integration is open source software. That means you can browse its source code and send improvements, or create your own fork and build it.
For more help
If you need more help, check out these support and learning resources:
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's data security and licenses documentation.