HAProxy monitoring integration

The HAProxy integration reports data from your HAProxy instance to New Relic Infrastructure. This document explains how to install and configure the HAProxy integration and describes the data collected.

Access to this feature depends on your subscription level. Requires Infrastructure Pro.

Features

The HAProxy on-host 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.

Compatibility and requirements

To use the HAProxy integration, ensure your system meets these requirements:

Install

On-host integrations do not automatically update. For best results, you should occasionally update the integration and update the Infrastructure agent.

To install the HAProxy integration:

  1. Follow the instructions for installing an integration, using the file name nri-haproxy.
  2. Via the command line, change directory to the integrations folder:
    cd /etc/newrelic-infra/integrations.d
  3. Create a copy of the sample configuration file by running:
    sudo cp haproxy-config.yml.sample haproxy-config.yml
  4. Edit the haproxy-config.yml configuration file using the configuration settings.
  5. Restart the infrastructure agent.

Configure

Use the HAProxy integration's haproxy-config.yml configuration file to put required login credentials and configure how data is collected. For an example configuration, see the example config file.

Commands

The haproxy-config.yml file provides 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 haproxy-config.yml 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.

Example haproxy-config.yml file configuration:

Example configuration
integration_name: com.newrelic.haproxy

instances:
  - name: haproxy
    # Command can be all_data, metrics, or inventory
    command: all_data
    arguments:
      # The URL to the enabled stats page on the 
      # HAProxy instance
      stats_url: http://haproxy-instance/stats
      # Basic auth username
      username: cacheuser
      # Basic auth password
      password: password

Find and use data

To find your integration data in Infrastructure, go to infrastructure.newrelic.com > Integrations > On-host integrations and select one of the HAProxy integration links.

In New Relic Insights, HAProxy data is attached to the following Insights event types:

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..

These attributes can be found by querying the HAProxyBackendSample event types in Insights.

Metric Description

backend.activeServers

Number of active servers.

backend.averageConnectTimeInSeconds

Average connect time over the 1024 last requests, in milliseconds.

backend.averageQueueTimeInSeconds

Average queue time over the 1024 last requests, in milliseconds.

backend.averageResponseTimeInSeconds

Average response time over the 1024 last requests, in milliseconds.

backend.averageTotalSessionTimeInSeconds

Average total session time over the 1024 last requests, in milliseconds.

backend.backupServers

Number of backup servers.

backend.bytesInPerSecond

Bytes received per second.

backend.bytesOutPerSecond

Bytes sent per second.

backend.bytesThatBypassedCompressorPerSecond

Number of bytes that bypassed the HTTP compressor per second.

backend.connectingRequestErrorsPerSecond

Number of requests that encountered an error trying to connect to a backend server per second.

backend.connectionRetriesPerSecond

Number of times a connection to a server was retried per second.

backend.cookieName

The name of the cookie.

backend.currentQueuedRequestsWithoutServer

Current queued requests without a server assigned.

backend.currentSessions

Number of current sessions.

backend.dataTransfersAbortedByClientPerSecond

Number of data transfers aborted by the client per second.

backend.dataTransfersAbortedByServerPerSecond

Number of data transfers aborted by the server per second.

backend.downtimeInSeconds

Total downtime in seconds.

backend.http100ResponsesPerSecond

HTTP responses with 1xx code per second.

backend.http200ResponsesPerSecond

HTTP responses with 2xx code per second.

backend.http300ResponsesPerSecond

HTTP responses with 3xx code per second.

backend.http400ResponsesPerSecond

HTTP responses with 4xx code per second.

backend.http500ResponsesPerSecond

HTTP responses with 5xx code per second.

backend.httpOtherResponsesPerSecond

HTTP responses with other codes (protocol error) per second.

backend.httpRequestsPerSecond

HTTP requests per second.

backend.httpResponseBytesEmittedByCompressorPerSecond

Number of HTTP response bytes emitted by the compressor per second.

backend.httpResponseBytesFedToCompressorPerSecond

Number of HTTP response bytes fed to the compressor per second.

backend.httpResponsesCompressedPerSecond

Number of HTTP responses that were compressed per second.

backend.interceptedRequestsPerSecond

Intercepted requests per second.

backend.maxQueuedRequestsWithoutServer

Maximum queued requests without a server assigned.

backend.maxSessions

Maximum number of sessions.

backend.maxSessionsPerSecond

Maximum number of new sessions per second.

backend.mode

The proxy mode. Options: tcp, http, health, unknown.

backend.proxyName

The name of the proxy.

backend.requestRedispatchPerSecond

Number of times a request was redispatched to another server per second.

backend.requestsDenied.securityConcernPerSecond

Requests denied bytcp-request connection rules per second.

backend.responseErrorsPerSecond

Response errors per second.

backend.responsesDenied.securityConcernPerSecond

Requests denied bytcp-request session rules per second.

backend.serverSelectedPerSecond

Number of times a server was selected per second, either for new sessions, or when re-dispatching.

backend.sessionsPerSecond

Sessions created per second.

backend.status

Status. Options: UP, DOWN, NOLB, MAINT, MAINT(via), MAINT(resolution).

backend.timeSinceLastSessionAssignedInSeconds

Number of seconds since last session assigned to backend.

backend.timeSinceLastUpDownTransitionInSeconds

Number of seconds since the last UP<->DOWN transition.

backend.totalWeight

Total weight of the backend.

backend.type

Type of backend. 0 = frontend, 1 = backend, 2 = server, 3 = socket/listener.

backend.upToDownTransitionsPerSecond

Number of UP->DOWN transitions per second.

These attributes can be found by querying the HAProxyFrontendSample event types in Insights.

Metric Description

frontend.bytesInPerSecond

Number of bytes received per second.

frontend.bytesOutPerSecond

Number of bytes sent per second.

frontend.connectionsPerSecond

Number of connections per second.

frontend.currentSessions

Number of current sessions.

frontend.http100ResponsesPerSecond

HTTP responses with 1xx code per second.

frontend.http200ResponsesPerSecond

HTTP responses with 2xx code per second.

frontend.http300ResponsesPerSecond

HTTP responses with 3xx code per second.

frontend.http400ResponsesPerSecond

HTTP responses with 4xx code per second.

frontend.http500ResponsesPerSecond

HTTP responses with 5xx code per second.

frontend.httpOtherResponsesPerSecond

HTTP responses with other codes (protocol error).

frontend.httpRequests.maxPerSecond

Max number of HTTP requests per second observed.

frontend.httpRequestsPerSecond

HTTP requests per second.

frontend.interceptedRequestsPerSecond

Intercepted requests per second.

frontend.maxConnectionsPerSecond

Maximum number of connections.

frontend.maxSessions

Maximum number of sessions.

frontend.maxSessionsPerSecond

Maximum number of new sessions per second.

frontend.mode

Proxy mode. One of tcp, http, health, unknown.

frontend.proxyName

The name of the proxy.

frontend.requestErrors

Request errors per second.

frontend.requestsDenied.securityConcernsPerSecond

Requests denied because of security concerns per second.

frontend.requestsDenied.tcpRequestConnectionRulesPerSecond

Requests denied bytcp-request connection rules per second.

frontend.requestsDenied.tcpRequestSessionRulesPerSecond

Requests denied bytcp-request session rules per second.

frontend.responsesDenied.securityConcernsPerSecond

Responses denied because of security concerns per second.

frontend.serviceName

The name of the service.

frontend.sessionsPerSecond

Sessions created per second.

frontend.status

The status of the frontend. Options: UP, DOWN, NOLB, MAINT, MAINT(via), MAINT(resolution).

frontend.type

Type of frontend. 0 = frontend, 1 = backend, 2 = server, 3 = socket/listener.

These attributes can be found by querying the HAProxyServerSample event types in Insights.

Metric Description

server.agentCheckContents

Last agent check contents or textual error.

server.agentDurationInSeconds

Time taken to finish last check, in milliseconds.

server.agentStatus

Status of the agent.

server.agentStatusDescription

Short human-readable description of agent_status.

server.averageConnectTimeInSeconds

Average connect time over the 1024 last requests, in milliseconds.

server.averageQueueTimeInSeconds

Average queue time over the 1024 last requests, in milliseconds.

server.averageResponseTimeInSeconds

Average response time over the 1024 last requests, in milliseconds.

server.averageTotalSessionTimeInSeconds

Average total session time over the 1024 last requests, in milliseconds.

server.bytesInPerSecond

Bytes received per second.

server.bytesOutPerSecond

Bytes sent per second.

server.checkStatusDescription

Short human-readable description of check_status.

server.connectingToBackendRequestErrorsPerSecond

Number of requests that encountered an error trying to connect to a backend server per second.

server.connectionRetriesPerSecond

Number of times a connection to a server was retried per second.

server.cookieValue

Server's cookie value.

server.currentSessions

Number of current sessions.

server.dataTransfersAbortedByClientPerSecond

Number of data transfers aborted by the client per second.

server.dataTransfersAbortedByServerPerSecond

Number of data transfers aborted by the server per second.

server.downtimeInSeconds

Total downtime in seconds.

server.failedChecksPerSecond

Number of failed checks per second.

server.failedHealthCheckDetails

Failed health check details.

server.healthCheckContents

Last health check contents or textual error.

server.healthCheckDurationInMilliseconds

Time it took to finish the last health check, in milliseconds.

server.healthCheckStatus

Health check status.

server.http100ResponsesPerSecond

HTTP responses with 1xx code per second.

server.http200ResponsesPerSecond

HTTP responses with 2xx code per second.

server.http300ResponsesPerSecond

HTTP responses with 3xx code per second.

server.http400ResponsesPerSecond

HTTP responses with 4xx code per second.

server.http500ResponsesPerSecond

HTTP responses with 5xx code per second.

server.httpOtherResponsesPerSecond

HTTP responses with other codes (protocol error).

server.isActive

Whether the server is active. 0 = Inactive, 1 = Active.

server.isBackup

Whether the server is a backup. 0 = Not Backup, 1 = Backup.

server.layerCode

Layer 5-7 code, if available.

server.maximumQueuedRequests

Maximum queued requests.

server.maxSessions

Number of maximum sessions.

server.maxSessionsPerSecond

Max sessions per second.

server.mode

Proxy mode. One of tcp, http, health, unknown.

server.proxyName

The name of the proxy.

server.queuedRequests

Current queued requests.

server.requestRedispatchPerSecond

Number of times a request was redispatched to another server per second.

server.requestsDenied.securityConcernPerSecond

Requests denied because of security concerns per second.

server.responseErrorsPerSecond

Response errors per second.

server.responsesDenied.securityConcernPerSecond

Responses denied because of security concerns per second.

server.serverID

The server ID.

server.serverSelectedPerSecond

Number of times a server was selected per second, either for new sessions, or when re-dispatching.

server.serverWeight

The server weight.

server.serviceName

The name of the service.

server.sessionsPerSecond

Sessions per second.

server.status

The status of the server. Options: UP, DOWN, NOLB, MAINT, MAINT(via), MAINT(resolution).

server.throttlePercentage

Throttle percentage for the server, when slowstart is active. Or no value if not in slowstart.

server.timeSinceLastSessionAssignedInSeconds

Number of seconds since last session assigned to backend.

server.timeSinceLastUpDownTransitionInSeconds

Number of seconds since the last UP<->DOWN transition.

server.type

The type of server. 0 = frontend, 1 = backend, 2 = server, 3 = socket/listener.

server.upToDownTransitionsPerSecond

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

iid

The backend proxy ID.

pid

The backend process ID.

slim

The backend session limit.

Frontend inventory

Name Description

iid

The frontend proxy ID.

pid

The frontend process ID.

rate_lim

New session per second limit.

slim

The frontend session limit.

Server inventory

Name Description

iid

The backend proxy ID.

pid

The server process ID.

qmax

The configured max queue. 0 = no limit.

sid

The server ID.

slim

The server session limit.

For more help

Recommendations for learning more: