Infrastructure Integration

Configuration

  1. Ensure that stats are enabled on your HAProxy configuration

Add the following to your haproxy.conf and restart haproxy:

listen stats :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 <your_username>:<your_password>  # Authentication credentials
  1. Configure the agent by editing /etc/netsil-dd-agent/conf.d/haproxy.yamlin the collectors.

Example:

init_config:

instances:
    - url: https://localhost:9000/haproxy_stats
      username: <your_username>
      password: <your_password>
  1. Check and make sure that all yaml files are valid with following command:

    /etc/init.d/netsil-collectors configcheck
    
  2. Restart the Agent using the following command:

    /etc/init.d/netsil-collectors restart
    
  3. Execute the info command to verify that the integration check has passed:

    /etc/init.d/netsil-collectors info
    

The output of the info command should contain a section similar to the following:

    Checks
    ======
      [...]
      haproxy
      ----------
          - instance #0 [OK]
          - Collected 8 metrics & 0 events

Infrastructure Datasources

Datasource Available Aggregations Unit Description
haproxy.backend_hosts avg max min sum host Number of backend hosts.
haproxy.backend.bytes.in_rate avg max min sum byte/second Rate of bytes in on backend hosts.
haproxy.backend.bytes.out_rate avg max min sum byte/second Rate of bytes out on backend hosts.
haproxy.backend.connect.time avg max min sum millisecond Average connect time over the last 1024 requests.
haproxy.backend.denied.req_rate avg max min sum request/second Number of requests denied due to security concerns.
haproxy.backend.denied.resp_rate avg max min sum response/second Number of responses denied due to security concerns.
haproxy.backend.errors.con_rate avg max min sum error/second Rate of requests that encountered an error trying to connect to a backend server.
haproxy.backend.errors.resp_rate avg max min sum error/second Rate of responses aborted due to error.
haproxy.backend.queue.current avg max min sum request Number of requests without an assigned backend.
haproxy.backend.queue.time avg max min sum millisecond Average queue time over the last 1024 requests.
haproxy.backend.response.1xx avg max min sum response Backend HTTP responses with 1xx code.
haproxy.backend.response.2xx avg max min sum response Backend HTTP responses with 2xx code.
haproxy.backend.response.3xx avg max min sum response Backend HTTP responses with 3xx code.
haproxy.backend.response.4xx avg max min sum response Backend HTTP responses with 4xx code.
haproxy.backend.response.5xx avg max min sum response Backend HTTP responses with 5xx code.
haproxy.backend.response.other avg max min sum response Backend HTTP responses with other code (protocol error).
haproxy.backend.response.time avg max min sum millisecond Average response time over the last 1024 requests (0 for TCP).
haproxy.backend.session.current avg max min sum connection Number of active backend sessions.
haproxy.backend.session.limit avg max min sum connection Configured backend session limit.
haproxy.backend.session.pct avg max min sum percent Percentage of sessions in use (backend.session.current/backend.session.limit * 100).
haproxy.backend.session.rate avg max min sum connection/second Number of backend sessions created per second.
haproxy.backend.session.time avg max min sum millisecond Average total session time over the last 1024 requests.
haproxy.backend.uptime avg max min sum second Number of seconds since the last UP<->DOWN transition
haproxy.backend.warnings.redis_rate avg max min sum error/second Number of times a connection to a server was retried.
haproxy.backend.warnings.retr_rate avg max min sum error/second Number of times a request was redispatched to another server.
haproxy.count_per_status avg max min sum host Number of hosts by status (UP/DOWN/NOLB/MAINT).
haproxy.frontend.bytes.in_rate avg max min sum byte/second Rate of bytes in on frontend hosts.
haproxy.frontend.bytes.out_rate avg max min sum byte/second Rate of bytes out on frontend hosts.
haproxy.frontend.denied.req_rate avg max min sum request/second Number of requests denied due to security concerns.
haproxy.frontend.denied.resp_rate avg max min sum response/second Number of responses denied due to security concerns.
haproxy.frontend.errors.req_rate avg max min sum error/second Rate of request errors.
haproxy.frontend.requests.rate avg max min sum request/second Number of HTTP requests per second.
haproxy.frontend.response.1xx avg max min sum response Frontend HTTP responses with 1xx code.
haproxy.frontend.response.2xx avg max min sum response Frontend HTTP responses with 2xx code.
haproxy.frontend.response.3xx avg max min sum response Frontend HTTP responses with 3xx code.
haproxy.frontend.response.4xx avg max min sum response Frontend HTTP responses with 4xx code.
haproxy.frontend.response.5xx avg max min sum response Frontend HTTP responses with 5xx code.
haproxy.frontend.response.other avg max min sum response Frontend HTTP responses with other code (protocol error).
haproxy.frontend.session.current avg max min sum connection Number of active frontend sessions.
haproxy.frontend.session.limit avg max min sum connection Configured backend session limit.
haproxy.frontend.session.pct avg max min sum percent Percentage of sessions in use (frontend.session.current/frontend.session.limit * 100).
haproxy.frontend.session.rate avg max min sum connection/second Number of frontend sessions created per second.