HAproxy Frontend | HAproxy

Dashboard

Last updated: 4 months ago

Downloads: 103

  • haproxy-frontend-2.PNG
    haproxy-frontend-2.PNG

This dashboard displays the detailed number of requests and their split by HTTP codes along aggregated throughput for the haproxy frontends.

It requires that you gather haproxy metrics using the haproxy_exporter from prometheus link

Example prometheus configuration:

  - job_name: 'loadbalancer1'
    static_configs:
      - targets: ['172.18.0.108:9101']
        labels:
          alias: loadbalancer1

You need to have the stats option configured in your global section of haproxy.cfg, example:

global
    log /dev/log    local0
    log /dev/log    local1 notice
    user haproxy
    group haproxy
    maxconn  16000
    stats  socket /var/lib/haproxy/stats level admin
    tune.bufsize  32768
    tune.maxrewrite  1024
    tune.ssl.default-dh-param 2048
    daemon

You can start the exporter to listen on the unix socket:

haproxy_exporter -haproxy.scrape-uri unix:/var/lib/haproxy/stats

You will need to apply the following two patches to your grafana server for these dashboards to work (as suggested by the percona app plugin).

sed -i 's/expr=\(.\)\.replace(\(.\)\.expr,\(.\)\.scopedVars\(.*\)var \(.\)=\(.\)\.interval/expr=\1.replace(\2.expr,\3.scopedVars\4var \5=\1.replace(\6.interval, \3.scopedVars)/' /usr/share/grafana/public/app/plugins/datasource/prometheus/datasource.js

sed -i 's/,range_input/.replace(\/"{\/g,"\\"").replace(\/}"\/g,"\\""),range_input/; s/step_input:""/step_input:this.target.step/' /usr/share/grafana/public/app/plugins/datasource/prometheus/query_ctrl.js
Download Dashboard
Dependencies: