Grafana dashboard: Celery / Tasks / By Task
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]. It shows task status by task.

{
  "__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": true,
  "gnetId": 17508,
  "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": "Tasks",
      "titleSize": "h6",
      "type": "row"
    },
    {
      "columns": [],
      "datasource": "$datasource",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 1
      },
      "id": 3,
      "links": [],
      "sort": {
        "col": 2,
        "desc": false
      },
      "span": "6",
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "hidden"
        },
        {
          "alias": "Job",
          "pattern": "job",
          "type": "hidden"
        },
        {
          "alias": "Success Rate",
          "decimals": "3",
          "pattern": "Value #A",
          "type": "number",
          "unit": "percentunit"
        },
        {
          "alias": "Suceeded",
          "decimals": "0",
          "pattern": "Value #B",
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Failed",
          "decimals": "0",
          "pattern": "Value #C",
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Sent",
          "decimals": "0",
          "pattern": "Value #D",
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Received",
          "decimals": "0",
          "pattern": "Value #E",
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Rejected",
          "decimals": "0",
          "pattern": "Value #F",
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Retried",
          "decimals": "0",
          "pattern": "Value #G",
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Revoked",
          "decimals": "0",
          "pattern": "Value #H",
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "expr": "sum (\n  round(\n    increase(\n      celery_task_succeeded_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__range]\n    )\n  )\n) by (name)\n/(sum (\n  round(\n    increase(\n      celery_task_succeeded_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__range]\n    )\n  )\n) by (name)\n+sum (\n  round(\n    increase(\n      celery_task_failed_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__range]\n    )\n  )\n) by (name)\n) > -1\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "A"
        },
        {
          "expr": "sum (\n  round(\n    increase(\n      celery_task_succeeded_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__range]\n    )\n  )\n) by (name) > 0\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "B"
        },
        {
          "expr": "sum (\n  round(\n    increase(\n      celery_task_failed_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__range]\n    )\n  )\n) by (name) > 0\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "C"
        },
        {
          "expr": "sum (\n  round(\n    increase(\n      celery_task_sent_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__range]\n    )\n  )\n) by (name) > 0\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "D"
        },
        {
          "expr": "sum (\n  round(\n    increase(\n      celery_task_received_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__range]\n    )\n  )\n) by (name) > 0\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "E"
        },
        {
          "expr": "sum (\n  round(\n    increase(\n      celery_task_rejected_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__range]\n    )\n  )\n) by (name) > 0\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "F"
        },
        {
          "expr": "sum (\n  round(\n    increase(\n      celery_task_retried_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__range]\n    )\n  )\n) by (name) > 0\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "G"
        },
        {
          "expr": "sum (\n  round(\n    increase(\n      celery_task_revoked_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__range]\n    )\n  )\n) by (name) > 0\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "H"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Task Stats",
      "type": "table"
    },
    {
      "columns": [],
      "datasource": "$datasource",
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 1
      },
      "id": 4,
      "links": [],
      "pageSize": 6,
      "sort": {
        "col": 3,
        "desc": true
      },
      "span": "4",
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "hidden"
        },
        {
          "alias": "Task",
          "pattern": "name"
        },
        {
          "alias": "Exception",
          "pattern": "exception"
        }
      ],
      "targets": [
        {
          "expr": "round(\n  sum (\n    increase(\n      celery_task_failed_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__range]\n    )\n  ) by (name, exception) > 0\n)\n",
          "format": "table",
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Task Exceptions",
      "type": "table"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$datasource",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 10,
        "w": 24,
        "x": 0,
        "y": 9
      },
      "id": 5,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "hideZero": true,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "sideWidth": null,
        "sort": "avg",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null as zero",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "repeat": null,
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum (\n  round(\n    increase(\n      celery_task_succeeded_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__rate_interval]\n    )\n  )\n) by (name)\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Succeeded - {{ name }}",
          "refId": "A"
        },
        {
          "expr": "sum (\n  round(\n    increase(\n      celery_task_failed_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__rate_interval]\n    )\n  )\n) by (name)\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Failed - {{ name }}",
          "refId": "B"
        },
        {
          "expr": "sum (\n  round(\n    increase(\n      celery_task_sent_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__rate_interval]\n    )\n  )\n) by (name)\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Sent - {{ name }}",
          "refId": "C"
        },
        {
          "expr": "sum (\n  round(\n    increase(\n      celery_task_received_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__rate_interval]\n    )\n  )\n) by (name)\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Received - {{ name }}",
          "refId": "D"
        },
        {
          "expr": "sum (\n  round(\n    increase(\n      celery_task_retried_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__rate_interval]\n    )\n  )\n) by (name)\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Retried - {{ name }}",
          "refId": "E"
        },
        {
          "expr": "sum (\n  round(\n    increase(\n      celery_task_rejected_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__rate_interval]\n    )\n  )\n) by (name)\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Rejected - {{ name }}",
          "refId": "F"
        },
        {
          "expr": "sum (\n  round(\n    increase(\n      celery_task_revoked_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__rate_interval]\n    )\n  )\n) by (name)\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Revoked - {{ name }}",
          "refId": "G"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Tasks completed",
      "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": 19
      },
      "id": 6,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "hideZero": true,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "sideWidth": null,
        "sort": "avg",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null as zero",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "repeat": null,
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum (\n  round(\n    increase(\n      celery_task_failed_total{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__rate_interval]\n    )\n  )\n) by (name, exception)\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "{{ name }} - {{ exception }}",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Task Exceptions",
      "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": 6,
        "w": 24,
        "x": 0,
        "y": 27
      },
      "id": 7,
      "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 as zero",
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "repeat": null,
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "histogram_quantile(0.50,\n  sum(\n    irate(\n      celery_task_runtime_bucket{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__rate_interval]\n    ) > 0\n  ) by (name, job, le)\n)\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "50 - {{ name }}",
          "refId": "A"
        },
        {
          "expr": "histogram_quantile(0.95,\n  sum(\n    irate(\n      celery_task_runtime_bucket{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__rate_interval]\n    ) > 0\n  ) by (name, job, le)\n)\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "95 - {{ name }}",
          "refId": "B"
        },
        {
          "expr": "histogram_quantile(0.99,\n  sum(\n    irate(\n      celery_task_runtime_bucket{\n        job=~\"celery|celery-exporter\",\n        name=~\"$task\",\n        queue_name=~\"$queue_name\"\n      }[$__rate_interval]\n    ) > 0\n  ) by (name, job, le)\n)\n",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "99 - {{ name }}",
          "refId": "C"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeShift": null,
      "title": "Tasks Runtime",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "s",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "s",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ]
    }
  ],
  "refresh": "",
  "rows": [],
  "schemaVersion": 14,
  "style": "dark",
  "tags": [
    "celery",
    "celery-mixin"
  ],
  "templating": {
    "list": [
      {
        "current": {
          "text": "Prometheus",
          "value": "Prometheus"
        },
        "hide": 0,
        "label": null,
        "name": "datasource",
        "options": [],
        "query": "prometheus",
        "refresh": 1,
        "regex": "",
        "type": "datasource"
      },
      {
        "allValue": ".*|",
        "current": {},
        "datasource": "$datasource",
        "hide": 0,
        "includeAll": true,
        "label": "Queue Name",
        "multi": true,
        "name": "queue_name",
        "options": [],
        "query": "label_values(celery_task_received_total{name!~\"None\"}, queue_name)",
        "refresh": 2,
        "regex": "",
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "$datasource",
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": true,
        "name": "task",
        "options": [],
        "query": "label_values(celery_task_received_total{queue_name=~\"$queue_name\", name!~\"None\"}, name)",
        "refresh": 2,
        "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 / By Task",
  "uid": "celery-tasks-by-task-32s3",
  "version": 0
}