Grafana dashboard: Lustre jobstats

Lustre jobstats dashboard with 4 panels and a link to a dashboard with the details of the one particular job selected in this panel (see below):

- Top 10 metadata rate jobstats
- Top10 hourly metadata jobstats
- Top20 data rate jobstats
- Top20 hourly aggregated jobstats

Notes:
- Depending on the number of job IDs and the processing capacity of prometheus the jobstats panels might time out. If this is the case try to reduce the granularity or use any other pre-processing aggregation for jobstats. The time picker in this dashboard is extremely important in order to have a running query not timing out.
- The link on this dashboard needs to be edited with your Grafana server address. It will also need the dashboard for the detailed jobstat view which we're also uploading.

{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS_STORAGE",
      "label": "Prometheus Storage",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    },
    {
      "name": "VAR_JOBID",
      "type": "constant",
      "label": "JobId",
      "value": "<JOBID>",
      "description": ""
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "5.2.4"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": "5.0.0"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "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"
      }
    ]
  },
  "editable": true,
  "gnetId": 9670,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1548259580302,
  "links": [
    {
      "icon": "dashboard",
      "includeVars": true,
      "keepTime": true,
      "tags": [],
      "targetBlank": true,
      "title": "JobID stats",
      "tooltip": "Set a jobid on the left dialog box and check stats per JobId",
      "type": "link",
      "url": "https://<grafana_server>/grafana/dashboard/db/lustre-lsf-job-stats"
    }
  ],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS_STORAGE}",
      "fill": 1,
      "gridPos": {
        "h": 10,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 9,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": false,
        "max": true,
        "min": false,
        "show": true,
        "sort": "max",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 2,
      "points": true,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "topk(10,sum(rate(lustre_job_stats_total{job=~\"$server\"}[2m])) by (jobid))",
          "format": "time_series",
          "interval": "120s",
          "intervalFactor": 5,
          "legendFormat": "{{jobid}}",
          "refId": "A",
          "step": 600
        }
      ],
      "thresholds": [],
      "timeFrom": "1h",
      "timeShift": null,
      "title": "Top10 Jobstats: metadata rate",
      "tooltip": {
        "shared": true,
        "sort": 2,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "iops",
          "label": "IOPS",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS_STORAGE}",
      "fill": 1,
      "gridPos": {
        "h": 9,
        "w": 24,
        "x": 0,
        "y": 10
      },
      "id": 10,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "max": true,
        "min": false,
        "show": true,
        "sort": "max",
        "sortDesc": 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": "topk(10,sum(lustre_job_stats_total{job=~\"$server\"} > 1000) by (jobid))",
          "format": "time_series",
          "interval": "1800s",
          "intervalFactor": 1,
          "legendFormat": "{{jobid}}",
          "refId": "A",
          "step": 1800
        }
      ],
      "thresholds": [],
      "timeFrom": "2h",
      "timeShift": null,
      "title": "Top10 hourly metadata jobstats",
      "tooltip": {
        "shared": true,
        "sort": 2,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "label": "# ops",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS_STORAGE}",
      "fill": 1,
      "gridPos": {
        "h": 11,
        "w": 24,
        "x": 0,
        "y": 19
      },
      "id": 20,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": false,
        "show": true,
        "sort": "max",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 2,
      "points": true,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "-topk(20,sum(rate(lustre_job_read_bytes_total{job=~\"$server\"}[2m])) by (jobid))",
          "format": "time_series",
          "interval": "2m",
          "intervalFactor": 2,
          "legendFormat": "{{jobid}}-read",
          "refId": "A",
          "step": 240
        },
        {
          "expr": "topk(20,sum(rate(lustre_job_write_bytes_total{job=~\"$server\"}[2m])) by (jobid))",
          "format": "time_series",
          "interval": "2m",
          "intervalFactor": 2,
          "legendFormat": "{{jobid}}-write",
          "refId": "B",
          "step": 240
        }
      ],
      "thresholds": [],
      "timeFrom": "6h",
      "timeShift": null,
      "title": "Top 20 Data rate jobstats",
      "tooltip": {
        "shared": true,
        "sort": 2,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "Bps",
          "label": "Read | Write",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS_STORAGE}",
      "fill": 1,
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 30
      },
      "id": 19,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "max": true,
        "min": false,
        "show": true,
        "sort": "max",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 2,
      "points": true,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "-topk(20,sum(lustre_job_read_bytes_total{job=~\"$server\"}) by (jobid))",
          "format": "time_series",
          "interval": "3600s",
          "intervalFactor": 1,
          "legendFormat": "{{jobid}}-read",
          "refId": "A",
          "step": 3600
        },
        {
          "expr": "topk(20,sum(lustre_job_write_bytes_total{job=~\"$server\"}) by (jobid))",
          "format": "time_series",
          "interval": "3600s",
          "intervalFactor": 1,
          "legendFormat": "{{jobid}}-write",
          "refId": "B",
          "step": 3600
        }
      ],
      "thresholds": [],
      "timeFrom": "6h",
      "timeShift": null,
      "title": "Top20 hourly aggregated data jobstats",
      "tooltip": {
        "shared": true,
        "sort": 2,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "decbytes",
          "label": "Read | Write",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "refresh": false,
  "schemaVersion": 16,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "value": "${VAR_JOBID}",
          "text": "${VAR_JOBID}"
        },
        "hide": 0,
        "label": "JobId",
        "name": "jobid",
        "options": [
          {
            "value": "${VAR_JOBID}",
            "text": "${VAR_JOBID}"
          }
        ],
        "query": "${VAR_JOBID}",
        "type": "constant"
      },
      {
        "allValue": "",
        "current": {},
        "datasource": "${DS_PROMETHEUS_STORAGE}",
        "hide": 0,
        "includeAll": true,
        "label": "Server",
        "multi": true,
        "name": "server",
        "options": [],
        "query": "label_values(lustre_exporter_build_info, job)",
        "refresh": 1,
        "regex": "",
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-1h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "1m",
      "2m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "browser",
  "title": "Lustre jobstats",
  "uid": "PFr06lwmk",
  "version": 1
}