Grafana dashboard: Celery / Tasks
Description: A dashboard that monitors Celery. It is created using the Celery-mixin for the the (Celery-exporter)[https://github.com/danihodovic/celery-exporter]

A dashboard that monitors Celery. It is created using the Celery-mixin for the the [Celery-exporter](https://github.com/danihodovic/celery-exporter).

{
  "__inputs": [],
  "__requires": [],
  "annotations": {
    "list": []
  },
  "description": "A dashboard that monitors Celery. It is created using the Celery-mixin for the the (Celery-exporter)[https://github.com/danihodovic/celery-exporter]",
  "editable": false,
  "gnetId": 14015,
  "graphTooltip": 0,
  "hideControls": false,
  "id": null,
  "links": [],
  "panels": [
    {
      "collapse": false,
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "panels": [],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": true,
      "title": "Summary",
      "titleSize": "h6",
      "type": "row"
    },
    {
      "datasource": "$datasource",
      "fieldConfig": {
        "defaults": {
          "links": [],
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": []
          },
          "unit": "none"
        }
      },
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 0,
        "y": 1
      },
      "id": 3,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "7",
      "targets": [
        {
          "expr": "count(celery_worker_up{job=~\"celery|celery-exporter\"} == 1)",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Celery Workers",
      "transparent": false,
      "type": "stat"
    },
    {
      "datasource": "$datasource",
      "fieldConfig": {
        "defaults": {
          "links": [],
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": []
          },
          "unit": "none"
        }
      },
      "gridPos": {
        "h": 4,
        "w": 5,
        "x": 4,
        "y": 1
      },
      "id": 4,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "7",
      "targets": [
        {
          "expr": "sum(celery_worker_tasks_active{job=~\"celery|celery-exporter\"})",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Tasks Active",
      "transparent": false,
      "type": "stat"
    },
    {
      "datasource": "$datasource",
      "fieldConfig": {
        "defaults": {
          "links": [],
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": []
          },
          "unit": "none"
        }
      },
      "gridPos": {
        "h": 4,
        "w": 5,
        "x": 9,
        "y": 1
      },
      "id": 5,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "7",
      "targets": [
        {
          "expr": "sum(round(increase(celery_task_received_total{job=~\"celery|celery-exporter\"}[1d])))\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Tasks received by workers last 24h",
      "transparent": false,
      "type": "stat"
    },
    {
      "datasource": "$datasource",
      "fieldConfig": {
        "defaults": {
          "links": [],
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": 0.95
              }
            ]
          },
          "unit": "percentunit"
        }
      },
      "gridPos": {
        "h": 4,
        "w": 5,
        "x": 14,
        "y": 1
      },
      "id": 6,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "7",
      "targets": [
        {
          "expr": "sum(round(increase(celery_task_succeeded_total{job=~\"celery|celery-exporter\"}[1d])))\n/(sum(round(increase(celery_task_succeeded_total{job=~\"celery|celery-exporter\"}[1d])))\n+sum(round(increase(celery_task_failed_total{job=~\"celery|celery-exporter\"}[1d])))\n)\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Successful completion rate last 24h",
      "transparent": false,
      "type": "stat"
    },
    {
      "datasource": "$datasource",
      "fieldConfig": {
        "defaults": {
          "links": [],
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": []
          },
          "unit": "none"
        }
      },
      "gridPos": {
        "h": 4,
        "w": 5,
        "x": 19,
        "y": 1
      },
      "id": 7,
      "links": [],
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "7",
      "targets": [
        {
          "expr": "sum(rate(celery_task_runtime_sum{job=~\"celery|celery-exporter\"}[1d])) / sum(rate(celery_task_runtime_count{job=~\"celery|celery-exporter\"}[1d])) > 0\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Average Runtime for Tasks last 24h",
      "transparent": false,
      "type": "stat"
    },
    {
      "columns": [],
      "datasource": "$datasource",
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 0,
        "y": 5
      },
      "id": 8,
      "links": [],
      "sort": {
        "col": 2,
        "desc": true
      },
      "span": "4",
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "hidden"
        },
        {
          "alias": "Task",
          "pattern": "name"
        }
      ],
      "targets": [
        {
          "expr": "round(topk(5, sum by (name) (increase(celery_task_failed_total{job=~\"celery|celery-exporter\"}[1d]) > 0 )))\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Top 5 failed tasks last 24h",
      "type": "table"
    },
    {
      "columns": [],
      "datasource": "$datasource",
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 8,
        "y": 5
      },
      "id": 9,
      "links": [],
      "sort": {
        "col": 2,
        "desc": true
      },
      "span": "4",
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "hidden"
        },
        {
          "alias": "Task",
          "pattern": "name"
        }
      ],
      "targets": [
        {
          "expr": "round(topk(5, sum by (exception) (increase(celery_task_failed_total{job=~\"celery|celery-exporter\"}[1d]) > 0 )))\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Top 5 exceptions last 24h",
      "type": "table"
    },
    {
      "columns": [],
      "datasource": "$datasource",
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 16,
        "y": 5
      },
      "id": 10,
      "links": [],
      "sort": {
        "col": 2,
        "desc": true
      },
      "span": "4",
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "hidden"
        },
        {
          "alias": "Task",
          "pattern": "name"
        }
      ],
      "targets": [
        {
          "expr": "topk(5, (sum by(name) (rate(celery_task_runtime_sum{job=~\"celery|celery-exporter\"}[1d])) / sum by (name) (rate(celery_task_runtime_count{job=~\"celery|celery-exporter\"}[1d])) > 0 ))\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Top 5 task runtime last 24h",
      "type": "table"
    },
    {
      "collapse": false,
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 13
      },
      "id": 11,
      "panels": [],
      "repeat": null,
      "repeatIteration": null,
      "repeatRowId": null,
      "showTitle": true,
      "title": "Individual Tasks",
      "titleSize": "h6",
      "type": "row"
    },
    {
      "columns": [],
      "datasource": "$datasource",
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 14
      },
      "id": 12,
      "links": [],
      "sort": {
        "col": 2,
        "desc": false
      },
      "span": "6",
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "hidden"
        },
        {
          "alias": "Task",
          "pattern": "name"
        },
        {
          "alias": "Success Rate",
          "pattern": "Value #A",
          "type": "number",
          "unit": "percentunit"
        },
        {
          "alias": "Received",
          "decimals": "0",
          "pattern": "Value #B",
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Succeeded",
          "decimals": "0",
          "pattern": "Value #C",
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Failed",
          "decimals": "0",
          "pattern": "Value #D",
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Rejected",
          "decimals": "0",
          "pattern": "Value #E",
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Retried",
          "decimals": "0",
          "pattern": "Value #F",
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Revoked",
          "decimals": "0",
          "pattern": "Value #G",
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "expr": "sum by (name) (round(increase(celery_task_succeeded_total{job=~\"celery|celery-exporter\", name=~\"$task\"}[$__range])))\n/(sum by (name) (round(increase(celery_task_succeeded_total{job=~\"celery|celery-exporter\", name=~\"$task\"}[$__range])))\n+sum by (name) (round(increase(celery_task_failed_total{job=~\"celery|celery-exporter\", name=~\"$task\"}[$__range])))\n)\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "A"
        },
        {
          "expr": "sum by (name) (round(increase(celery_task_received_total{job=~\"celery|celery-exporter\", name=~\"$task\"}[$__range])))\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "B"
        },
        {
          "expr": "sum by (name) (round(increase(celery_task_succeeded_total{job=~\"celery|celery-exporter\", name=~\"$task\"}[$__range])))\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "C"
        },
        {
          "expr": "sum by (name) (round(increase(celery_task_failed_total{job=~\"celery|celery-exporter\", name=~\"$task\"}[$__range])))\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "D"
        },
        {
          "expr": "sum by (name) (round(increase(celery_task_rejected_total{job=~\"celery|celery-exporter\", name=~\"$task\"}[$__range])))\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "E"
        },
        {
          "expr": "sum by (name) (round(increase(celery_task_retried_total{job=~\"celery|celery-exporter\", name=~\"$task\"}[$__range])))\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "F"
        },
        {
          "expr": "sum by (name) (round(increase(celery_task_revoked_total{job=~\"celery|celery-exporter\", name=~\"$task\"}[$__range])))\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "G"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Task Stats",
      "type": "table"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$datasource",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 10,
        "w": 24,
        "x": 0,
        "y": 22
      },
      "id": 13,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "hideZero": true,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "sideWidth": null,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "repeat": null,
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum by (name) (round(increase(celery_task_succeeded_total{job=~\"celery|celery-exporter\", name=~\"$task\"}[10m])))\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Succeeded - {{ name }}",
          "refId": "A"
        },
        {
          "expr": "sum by (name) (round(increase(celery_task_failed_total{job=~\"celery|celery-exporter\", name=~\"$task\"}[10m])))\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Failed - {{ name }}",
          "refId": "B"
        },
        {
          "expr": "sum by (name) (round(increase(celery_task_received_total{job=~\"celery|celery-exporter\", name=~\"$task\"}[10m])))\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Received - {{ name }}",
          "refId": "C"
        },
        {
          "expr": "sum by (name) (round(increase(celery_task_retried_total{job=~\"celery|celery-exporter\", name=~\"$task\"}[10m])))\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Retried - {{ name }}",
          "refId": "D"
        },
        {
          "expr": "sum by (name) (round(increase(celery_task_rejected_total{job=~\"celery|celery-exporter\", name=~\"$task\"}[10m])))\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Rejected - {{ name }}",
          "refId": "E"
        },
        {
          "expr": "sum by (name) (round(increase(celery_task_revoked_total{job=~\"celery|celery-exporter\", name=~\"$task\"}[10m])))\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Revoked - {{ name }}",
          "refId": "F"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Tasks completed with 10m intervals",
      "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": "$datasource",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 32
      },
      "id": 14,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "hideZero": true,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "sideWidth": null,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "repeat": null,
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum by (name) (rate(celery_task_runtime_sum{job=~\"celery|celery-exporter\", name=~\"$task\"}[10m])) / sum by (name) (rate(celery_task_runtime_count{job=~\"celery|celery-exporter\", name=~\"$task\"}[10m])) > 0\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "{{ name }}",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Tasks Runtime with 10m intervals",
      "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
        }
      ]
    }
  ],
  "refresh": "",
  "rows": [],
  "schemaVersion": 14,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "text": "Prometheus",
          "value": "Prometheus"
        },
        "hide": 0,
        "label": null,
        "name": "datasource",
        "options": [],
        "query": "prometheus",
        "refresh": 1,
        "regex": "",
        "type": "datasource"
      },
      {
        "allValue": null,
        "current": {
          "text": "",
          "value": ""
        },
        "datasource": "$datasource",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "task",
        "options": [],
        "query": "label_values(celery_task_sent_total, name)",
        "refresh": 1,
        "regex": "",
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-2d",
    "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": "utc",
  "title": "Celery / Tasks",
  "uid": "celery-exporter",
  "version": 0
}