Grafana dashboard: Gerrit - Healthcheck
Description: Dashboard showing the Gerrit server health using metrics provided by the healthcheck plugin

# Gerrit Healthcheck dashboard

This dashboard is being maintained as part of the gerrit-monitoring project. It is meant to be used with the metrics-reporter-prometheus plugin for Gerrit and Prometheus. The project provides a Kubernetes-based setup to install a complete monitoring and logging stack. Multiple dashboards are available.

{
  "__inputs": [
    {
      "description": "",
      "label": "Prometheus",
      "name": "DS_PROMETHEUS",
      "pluginId": "prometheus",
      "pluginName": "Prometheus",
      "type": "datasource"
    }
  ],
  "__requires": [
    {
      "id": "grafana",
      "name": "Grafana",
      "type": "grafana",
      "version": "7.1.5"
    },
    {
      "id": "graph",
      "name": "Graph",
      "type": "panel",
      "version": ""
    },
    {
      "id": "prometheus",
      "name": "Prometheus",
      "type": "datasource",
      "version": "1.0.0"
    }
  ],
  "annotations": {
    "list": []
  },
  "editable": false,
  "gnetId": 14642,
  "graphTooltip": 2,
  "hideControls": false,
  "id": null,
  "links": [],
  "panels": [
    {
      "collapse": false,
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 0
      },
      "id": 2,
      "panels": [],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": true,
      "title": "CURRENT",
      "titleSize": "h6",
      "type": "row"
    },
    {
      "datasource": "${DS_PROMETHEUS}",
      "fieldConfig": {
        "defaults": {
          "decimals": 2,
          "displayName": "${check}",
          "links": [],
          "mappings": [
            {
              "from": "",
              "id": 0,
              "text": "ok",
              "to": "",
              "type": 1,
              "value": "1"
            },
            {
              "from": "",
              "id": 1,
              "text": "failed",
              "to": "",
              "type": 1,
              "value": "0"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-red",
                "value": null
              },
              {
                "color": "semi-dark-green",
                "value": 1
              }
            ]
          },
          "unit": "none"
        }
      },
      "gridPos": {
        "h": 6,
        "w": 3
      },
      "id": 3,
      "links": [],
      "maxPerRow": 8,
      "options": {
        "colorMode": "background",
        "graphMode": "none",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "mean"
          ],
          "fields": "",
          "values": false
        }
      },
      "pluginVersion": "7",
      "repeat": "check",
      "repeatDirection": "h",
      "targets": [
        {
          "expr": "1-clamp_max(increase(plugins_healthcheck_${check}_failure_total{instance=\"$instance\",replica=\"$replica\"}[2m]), 1)",
          "format": "time_series",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "",
      "transparent": false,
      "type": "stat"
    },
    {
      "collapse": false,
      "collapsed": false,
      "gridPos": {
        "x": 0,
        "y": 6
      },
      "id": 4,
      "panels": [],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": true,
      "title": "OVER TIME",
      "titleSize": "h6",
      "type": "row"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 0,
      "fill": 5,
      "gridPos": {
        "h": 6,
        "w": 8,
        "x": 0,
        "y": 6
      },
      "id": 5,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "rightSide": false,
        "show": true,
        "sideWidth": null,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "maxPerRow": 3,
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "repeat": "check",
      "repeatDirection": "h",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "1-clamp_max(increase(plugins_healthcheck_${check}_failure_total{instance=\"$instance\",replica=\"$replica\"}[2m]), 1)",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "${check}",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "${check}",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": 0,
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": 1,
          "min": 0,
          "show": true
        },
        {
          "decimals": 0,
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": 1,
          "min": 0,
          "show": true
        }
      ]
    }
  ],
  "refresh": "1m",
  "rows": [],
  "schemaVersion": 22,
  "style": "dark",
  "tags": [
    "gerrit"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "hide": 0,
        "includeAll": false,
        "label": "Gerrit Instance",
        "multi": false,
        "name": "instance",
        "options": [],
        "query": "label_values(git_upload_pack_phase_writing_total, instance)",
        "refresh": 1,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "hide": 0,
        "includeAll": false,
        "label": "Replica",
        "multi": false,
        "name": "replica",
        "options": [],
        "query": "label_values(git_upload_pack_phase_writing_total{instance=\"$instance\"}, replica)",
        "refresh": 2,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "hide": 0,
        "includeAll": true,
        "label": "Check",
        "multi": true,
        "name": "check",
        "options": [],
        "query": "metrics(^plugins_healthcheck_.+_failure_total$)",
        "refresh": 2,
        "regex": "plugins_healthcheck_(.+)_failure_total",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-24h",
    "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": "browser",
  "title": "Gerrit - Healthcheck",
  "version": 0,
  "description": "Dashboard showing the Gerrit server health using metrics provided by the healthcheck plugin"
}