Grafana dashboard: HAProxy Metrics - Single
Description: HAProxy metrics and statistics

Display HAProxy metrics for a single Telegraf instance, selectable via drop-down. Metrics are grouped into collapsible rows. Provides option to filter or multi-select proxy.

{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "5.0.4"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": "5.0.0"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "5.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": "5.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "HAProxy metrics and statistics",
  "editable": true,
  "gnetId": 6416,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1528321048701,
  "links": [],
  "panels": [
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 23,
      "panels": [],
      "title": "Backend Status",
      "type": "row"
    },
    {
      "cacheTimeout": null,
      "colorBackground": true,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "description": "Number of active servers (backend), server is active (server)",
      "format": "short",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 0,
        "y": 1
      },
      "id": 4,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "sum(haproxy_active_servers{server=\"$server\", status!=\"UP\", type=\"backend\", proxy=~\"$proxy\"})",
          "format": "time_series",
          "instant": true,
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "thresholds": "1,0",
      "title": "Active Backends Down",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "0",
          "value": "null"
        }
      ],
      "valueName": "total"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "description": "Number of active servers (backend), server is active (server)\nNumber of backup servers (backend), server is backup (server)",
      "fill": 0,
      "gridPos": {
        "h": 8,
        "w": 20,
        "x": 4,
        "y": 1
      },
      "id": 2,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 2,
      "links": [],
      "nullPointMode": "null as zero",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "Active Down",
          "color": "#890f02"
        },
        {
          "alias": "Backup Down",
          "color": "#ea6460"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum(haproxy_active_servers{server=\"$server\", status=\"UP\", type=\"backend\", proxy=~\"$proxy\"})",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Active UP",
          "refId": "A"
        },
        {
          "expr": "sum(haproxy_active_servers{server=\"$server\", status!=\"UP\", type=\"backend\", proxy=~\"$proxy\"})",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Active Down",
          "refId": "B"
        },
        {
          "expr": "sum(haproxy_backup_servers{server=\"$server\", status=\"UP\", type=\"backend\", proxy=~\"$proxy\"})",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Backup UP",
          "refId": "C"
        },
        {
          "expr": "sum(haproxy_backup_servers{server=\"$server\", status!=\"UP\", type=\"backend\", proxy=~\"$proxy\"})",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Backup Down",
          "refId": "D"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Backend Status",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ]
    },
    {
      "cacheTimeout": null,
      "colorBackground": true,
      "colorValue": false,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "description": "Number of backup servers (backend), server is backup (server)",
      "format": "short",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 0,
        "y": 5
      },
      "id": 5,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "sum(haproxy_backup_servers{server=\"$server\", status!=\"UP\", type=\"backend\", proxy=~\"$proxy\"})",
          "format": "time_series",
          "instant": true,
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "thresholds": "1,0",
      "title": "Backup Backends Down",
      "type": "singlestat",
      "valueFontSize": "80%",
      "valueMaps": [
        {
          "op": "=",
          "text": "0",
          "value": "null"
        }
      ],
      "valueName": "total"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 9
      },
      "id": 25,
      "panels": [],
      "title": "Sessions & Requests",
      "type": "row"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "description": "Number of sessions per second over last elapsed second",
      "fill": 1,
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 10
      },
      "id": 17,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": true,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "Backend",
          "transform": "negative-Y"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum(haproxy_rate{server=\"$server\", proxy=~\"$proxy\", type=\"frontend\"})",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Frontend",
          "refId": "A"
        },
        {
          "expr": "sum(haproxy_rate{server=\"$server\", proxy=~\"$proxy\", type=\"backend\"})",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Backend",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Sessions/s Frontend over Backend",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ]
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fill": 1,
      "gridPos": {
        "h": 6,
        "w": 12,
        "x": 0,
        "y": 17
      },
      "id": 15,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum(haproxy_req_rate{server=\"$server\", proxy=~\"$proxy\"})",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Requests",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Frontend Requests/s",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ]
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "description": "Current queued requests. For the backend this reports the number queued without a server assigned.",
      "fill": 1,
      "gridPos": {
        "h": 6,
        "w": 12,
        "x": 12,
        "y": 17
      },
      "id": 21,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum(haproxy_qcur{server=\"$server\", proxy=~\"$proxy\", type=\"backend\"})",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Queued Requests",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Current Queued Requests",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ]
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 23
      },
      "id": 27,
      "panels": [],
      "title": "HTTP Response Codes",
      "type": "row"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "fill": 1,
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 24
      },
      "id": 7,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": true,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "/Backend.*/",
          "transform": "negative-Y"
        },
        {
          "alias": "/.*1xx/",
          "color": "#64b0c8"
        },
        {
          "alias": "/.*2xx/",
          "color": "#508642"
        },
        {
          "alias": "/.*3xx/",
          "color": "#c15c17"
        },
        {
          "alias": "/.*4xx/",
          "color": "#cca300"
        },
        {
          "alias": "/.*5xx/",
          "color": "#890f02"
        },
        {
          "alias": "/.*other/",
          "color": "#584477"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum(rate(haproxy_http_response_1xx{server=\"$server\", proxy=~\"$proxy\", type=\"frontend\"}[5m]))",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Frontend 1xx",
          "refId": "A"
        },
        {
          "expr": "sum(rate(haproxy_http_response_1xx{server=\"$server\", proxy=~\"$proxy\", type=\"backend\"}[5m]))",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Backend 1xx",
          "refId": "B"
        },
        {
          "expr": "sum(rate(haproxy_http_response_2xx{server=\"$server\", proxy=~\"$proxy\", type=\"frontend\"}[5m]))",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Frontend 2xx",
          "refId": "C"
        },
        {
          "expr": "sum(rate(haproxy_http_response_2xx{server=\"$server\", proxy=~\"$proxy\", type=\"backend\"}[5m]))",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Backend 2xx",
          "refId": "D"
        },
        {
          "expr": "sum(rate(haproxy_http_response_3xx{server=\"$server\", proxy=~\"$proxy\", type=\"frontend\"}[5m]))",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Frontend 3xx",
          "refId": "E"
        },
        {
          "expr": "sum(rate(haproxy_http_response_3xx{server=\"$server\", proxy=~\"$proxy\", type=\"backend\"}[5m]))",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Backend 3xx",
          "refId": "F"
        },
        {
          "expr": "sum(rate(haproxy_http_response_4xx{server=\"$server\", proxy=~\"$proxy\", type=\"frontend\"}[5m]))",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Frontend 4xx",
          "refId": "G"
        },
        {
          "expr": "sum(rate(haproxy_http_response_4xx{server=\"$server\", proxy=~\"$proxy\", type=\"backend\"}[5m]))",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Backend 4xx",
          "refId": "H"
        },
        {
          "expr": "sum(rate(haproxy_http_response_5xx{server=\"$server\", proxy=~\"$proxy\", type=\"frontend\"}[5m]))",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Frontend 5xx",
          "refId": "K"
        },
        {
          "expr": "sum(rate(haproxy_http_response_5xx{server=\"$server\", proxy=~\"$proxy\", type=\"backend\"}[5m]))",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Backend 5xx",
          "refId": "L"
        },
        {
          "expr": "sum(rate(haproxy_http_response_other{server=\"$server\", proxy=~\"$proxy\", type=\"frontend\"}[5m]))",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Frontend Other",
          "refId": "I"
        },
        {
          "expr": "sum(rate(haproxy_http_response_other{server=\"$server\", proxy=~\"$proxy\", type=\"backend\"}[5m]))",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Backend Other",
          "refId": "J"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "HTTP Response Rate by Code Frontend over Backend",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ]
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 32
      },
      "id": 29,
      "panels": [],
      "title": "Data Rates",
      "type": "row"
    },
    {
      "aliasColors": {
        "Backend IN": "#e5ac0e",
        "Backend OUT": "#f9934e",
        "Frontend IN": "#0a50a1",
        "Frontend OUT": "#052b51"
      },
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "description": "bin [LFBS]: bytes in\nbout [LFBS]: bytes out",
      "fill": 1,
      "gridPos": {
        "h": 11,
        "w": 24,
        "x": 0,
        "y": 33
      },
      "id": 19,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "/.*OUT/",
          "transform": "negative-Y"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum(rate(haproxy_bin{server=\"$server\", proxy=~\"$proxy\", type=\"frontend\"}[5m]))",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Frontend IN",
          "refId": "A"
        },
        {
          "expr": "sum(rate(haproxy_bin{server=\"$server\", proxy=~\"$proxy\", type=\"backend\"}[5m]))",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Backend IN",
          "refId": "B"
        },
        {
          "expr": "sum(rate(haproxy_bout{server=\"$server\", proxy=~\"$proxy\", type=\"frontend\"}[5m]))",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Frontend OUT",
          "refId": "C"
        },
        {
          "expr": "sum(rate(haproxy_bout{server=\"$server\", proxy=~\"$proxy\", type=\"backend\"}[5m]))",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Backend OUT",
          "refId": "D"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Data Rate Bytes IN over OUT",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "Bps",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ]
    }
  ],
  "refresh": "5m",
  "schemaVersion": 16,
  "style": "dark",
  "tags": [
    "prometheus",
    "telegraf",
    "haproxy"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "hide": 0,
        "includeAll": false,
        "label": "server",
        "multi": false,
        "name": "server",
        "options": [],
        "query": "label_values(haproxy_active_servers, server)",
        "refresh": 1,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": ".*",
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "hide": 0,
        "includeAll": true,
        "label": "proxy",
        "multi": true,
        "name": "proxy",
        "options": [],
        "query": "label_values(haproxy_active_servers{server=\"$server\"}, proxy)",
        "refresh": 1,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "HAProxy Metrics - Single",
  "uid": "LC7OkcImk",
  "version": 11
}