HAProxy Data Collector Edit on GitHub Request doc changes

Contributors netapp-alavoie

Cloud Insights uses this data collector to gather metrics from HAProxy.

Installation

  1. From Admin > Data Collectors, click +Data Collector. Under Services, choose HAProxy.

    Select the Operating System or Platform on which the Telegraf agent is installed.

  2. If you haven’t already installed an Agent for collection, or you wish to install an Agent for a different Operating System or Platform, click Show Instructions to expand the Agent installation instructions.

  3. Select the Agent Access Key for use with this data collector. You can add a new Agent Access Key by clicking the + Agent Access Key button. Best practice: Use a different Agent Access Key only when you want to group data collectors, for example, by OS/Platform.

  4. Follow the configuration steps to configure the data collector. The instructions vary depending on the type of Operating System or Platform you are using to collect data.

HAProxy configuration

Setup

Telegraf’s plugin for HAProxy relies on HAProxy Stats enablement. This is a configuration built into HAProxy but it is not enabled out of the box. When enabled, HAProxy will expose an HTML endpoint that can be viewed on your browser or scraped for extraction of status of all HAProxy configurations.

Compatibility:

Configuration was developed against HAProxy version 1.9.4.

Setting Up:

To enable stats, edit your haproxy configuration file and add the the following lines after the 'defaults' section, using your own user/password and/or haproxy URL:

stats enable
stats auth myuser:mypassword
stats uri  /haproxy?stats

The following is a simplified example configuration file with stats enabled:

global
  daemon
  maxconn 256

defaults
  mode http
  stats enable
  stats uri /haproxy?stats
  stats auth myuser:mypassword
  timeout connect 5000ms
  timeout client 50000ms
  timeout server 50000ms

frontend http-in
  bind *:80
  default_backend servers

frontend http-in9080
  bind *:9080
  default_backend servers_2

backend servers
  server server1 10.128.0.55:8080 check ssl verify none
  server server2 10.128.0.56:8080 check ssl verify none

backend servers_2
  server server3 10.128.0.57:8080 check ssl verify none
  server server4 10.128.0.58:8080 check ssl verify none

For complete and up to date instructions, see the HAProxy documentation.

Objects and Counters

The following objects and their counters are collected:

Object: Identifiers: Attributes: Datapoints:

HAProxy Frontend

Namespace
Address
Proxy

Node IP
Node Name
Proxy ID
Mode
Process id
Sessions Rate Limit
Server id
Sessions Limit
Status

Bytes In
Bytes Out
Cache Hits
Cache Lookups
Compression Bytes Bypassed
Compression Bytes In
Compression Bytes Out
Compression Responses
Connection Rate
Connection Rate Max
Connections Total
Requests Denied by Connection Rule
Requests Denied by Security Concerns
Responses Denied by Security Concerns
Requests Denied by Session Rule
Requests Errors
Responses 1xx
Responses 2xx
Responses 3xx
Responses 4xx
Responses 5xx
Responses Other
Requests Intercepted
Sessions Rate
Sessions Rate Max
Requests Rate
Requests Rate Max
Requests Total
Sessions
Sessions Max
Sessions Total
Requests Rewrites

HAProxy Server

Namespace
Address
Proxy
Server

Node IP
Node Name
Check Time to Finish
Check Fall Configuration
Check Health Value
Check Rise Configuration
Check Status
Proxy ID
Last Change Time
Last Session Time
Mode
Process id
Server id
Status
Weight

Active Servers
Backup Servers
Bytes In
Bytes Out
Check Downs
Check Fails
Client Aborts
Connections
Connection Average Time
Downtime Total
Denied Responses
Connection Errors
Response Errors
Responses 1xx
Responses 2xx
Responses 3xx
Responses 4xx
Responses 5xx
Responses Other
Server Selected Total
Queue Current
Queue Max
Queue Average Time
Sessions per Second
Sessions per Second Max
Connection Reuse
Response Time Average
Sessions
Sessions Max
Server Transfer Aborts
Sessions Total
Sessions Total Time Average
Requests Redispatches
Requests Retries
Requests Rewrites

HAProxy Backend

Namespace
Address
Proxy

Node IP
Node Name
Proxy ID
Last Change Time
Last Session Time
Mode
Process id
Server id
Sessions Limit
Status
Weight

Active Servers
Backup Servers
Bytes In
Bytes Out
Cache Hits
Cache Lookups
Check Downs
Client Aborts
Compression Bytes Bypassed
Compression Bytes In
Compression Bytes Out
Compression Responses
Connections
Connection Average Time
Downtime Total
Requests Denied by Security Concerns
Responses Denied by Security Concerns
Connection Errors
Response Errors
Responses 1xx
Responses 2xx
Responses 3xx
Responses 4xx
Responses 5xx
Responses Other
Server Selected Total
Queue Current
Queue Max
Queue Average Time
Sessions per Second
Sessions per Second Max
Requests Total
Connection Reuse
Response Time Average
Sessions
Sessions Max
Server Transfer Aborts
Sessions Total
Sessions Total Time Average
Requests Redispatches
Requests Retries
Requests Rewrites

Troubleshooting

Additional information may be found from the Support page.