From d8582bca52477a115869d8e0c7e4a597fb4020b7 Mon Sep 17 00:00:00 2001 From: Antoine Rabany Date: Mon, 1 Aug 2022 14:58:57 +0200 Subject: [PATCH] chore(doc): add exported grafana dashboard --- docs/source/_static/remoulade-dashboard.json | 914 +++++++++++++++++++ docs/source/advanced.rst | 4 +- 2 files changed, 916 insertions(+), 2 deletions(-) create mode 100644 docs/source/_static/remoulade-dashboard.json diff --git a/docs/source/_static/remoulade-dashboard.json b/docs/source/_static/remoulade-dashboard.json new file mode 100644 index 000000000..484c2d461 --- /dev/null +++ b/docs/source/_static/remoulade-dashboard.json @@ -0,0 +1,914 @@ +{ + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + }, + { + "name": "DS_THANOS", + "label": "Thanos", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + }, + { + "name": "VAR_KIBANA_URL", + "type": "constant", + "label": "kibana url", + "value": "", + "description": "" + } + ], + "__elements": [], + "__requires": [ + { + "type": "panel", + "id": "bargauge", + "name": "Bar gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.5.0" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "A dashboard for Remoulade, a distributed task processing library for Python.", + "editable": true, + "fiscalYearStartMonth": 0, + "gnetId": 3692, + "graphTooltip": 1, + "id": null, + "iteration": 1659357880105, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/processed/" + }, + "properties": [ + { + "id": "custom.lineWidth", + "value": 0 + }, + { + "id": "unit", + "value": "short" + } + ] + } + ] + }, + "gridPos": { + "h": 9, + "w": 9, + "x": 0, + "y": 0 + }, + "id": 1, + "interval": "30s", + "links": [], + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "exemplar": true, + "expr": "sum by(actor_name)(increase(remoulade_message_duration_milliseconds_count{namespace=\"$namespace\", job=~\"$env-.*\"}[$__rate_interval])) > 0", + "hide": true, + "interval": "", + "intervalFactor": 4, + "legendFormat": "{{actor_name}}", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "exemplar": true, + "expr": "sum by(actor_name) (actor_name:remoulade_message_duration_milliseconds_count:increase5m{namespace=\"$namespace\", service=~\"$env-.*\"}> 0)", + "hide": false, + "interval": "", + "legendFormat": "{{actor_name}}", + "refId": "B" + } + ], + "title": "Message processing", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 9, + "x": 9, + "y": 0 + }, + "id": 6, + "interval": "30s", + "links": [], + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "exemplar": true, + "expr": "sum by(actor_name)(increase(remoulade_message_retries_total{namespace=\"$namespace\", job=~\"$env-.*\"}[$__rate_interval])) > 0", + "format": "time_series", + "hide": true, + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{actor_name}} retried", + "metric": "", + "refId": "A", + "step": 2 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "exemplar": true, + "expr": "sum by(actor_name) (actor_name:remoulade_message_retries_total:increase5m{namespace=\"$namespace\", service=~\"$env-.*\"} > 0)", + "hide": false, + "interval": "", + "legendFormat": "{{actor_name}} retried", + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "exemplar": true, + "expr": "sum by(actor_name)(increase(remoulade_message_rejects_total{namespace=\"$namespace\", job=~\"$env-.*\"}[$__rate_interval])) > 0", + "format": "time_series", + "hide": true, + "interval": "", + "intervalFactor": 2, + "legendFormat": "{{actor_name}} failed", + "refId": "B", + "step": 2 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "exemplar": true, + "expr": "sum by(actor_name) (actor_name:remoulade_message_rejects_total:increase5m{namespace=\"$namespace\", service=~\"$env-.*\"}) > 0", + "hide": false, + "interval": "", + "legendFormat": "{{actor_name}} failed", + "refId": "D" + } + ], + "title": "Message retries", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd" + }, + "decimals": 1, + "links": [ + { + "targetBlank": true, + "title": "kibana", + "url": "${kibana_url}/app/discover#/?_g=(filters:!(),time:(from:'${__from:date}',to:'${__to:date}'))&_a=(columns:!(wiremind.message,wiremind.trace_id),filters:!(('$state':(store:appState),query:(match_phrase:(wiremind.message:'Actor ${__series.name}'))),('$state':(store:appState),query:(match_phrase:(wiremind.app_name:$env)))))\n" + } + ], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 5000 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 6, + "x": 18, + "y": 0 + }, + "id": 9, + "interval": "30s", + "links": [], + "options": { + "displayMode": "gradient", + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "text": {} + }, + "pluginVersion": "8.5.0", + "targets": [ + { + "$$hashKey": "object:995", + "aggregation": "Last", + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "decimals": 2, + "displayAliasType": "Warning / Critical", + "displayType": "Regular", + "displayValueWithAlias": "Never", + "exemplar": true, + "expr": "sum by(actor_name)(rate(remoulade_message_duration_milliseconds_sum{namespace=\"$namespace\", job=~\"$env-.*\"}[$__rate_interval])) /\nsum by(actor_name)(rate(remoulade_message_duration_milliseconds_count{namespace=\"$namespace\", job=~\"$env-.*\"}[$__rate_interval])) > 0", + "format": "time_series", + "hide": true, + "instant": false, + "interval": "", + "intervalFactor": 4, + "legendFormat": "{{actor_name}}", + "metric": "dramatiq_messages_total", + "refId": "B", + "step": 2, + "units": "none", + "valueHandler": "Number Threshold" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "exemplar": true, + "expr": "avg by (actor_name) (actor_name:remoulade_message_duration_milliseconds:mean5m{namespace=\"$namespace\", service=~\"$env-.*\"} > 0)", + "hide": false, + "instant": false, + "interval": "", + "legendFormat": "{{actor_name}}", + "refId": "A" + } + ], + "title": "Message processing time", + "type": "bargauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 8, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "exemplar": true, + "expr": "avg by (queue) (rabbitmq_queue_messages{namespace=\"$namespace\", queue!~\"^.+(DQ|XQ)$\", queue!=\"wiremind_check_service\", job=~\"$env-.*\"})", + "interval": "", + "legendFormat": "{{queue}}", + "refId": "A" + } + ], + "title": "Messages per queue", + "transformations": [], + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 7, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 11, + "interval": "30s", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "right" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "exemplar": true, + "expr": "sum by(actor_name)(rate(remoulade_message_duration_milliseconds_sum{namespace=\"$namespace\", job=~\"$env-.*\"}[$__rate_interval])) /\nsum by(actor_name)(rate(remoulade_message_duration_milliseconds_count{namespace=\"$namespace\", job=~\"$env-.*\"}[$__rate_interval])) > 0", + "hide": true, + "interval": "", + "legendFormat": "{{function_name}}", + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "exemplar": true, + "expr": "max by(actor_name) (actor_name:remoulade_message_duration_milliseconds:mean5m{namespace=\"$namespace\", service=~\"$env-.*\"} > 0)", + "hide": false, + "interval": "", + "legendFormat": "{{actor_name}}", + "refId": "A" + } + ], + "title": "Load tasks mean time", + "transformations": [], + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 17 + }, + "id": 13, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.3.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_THANOS}" + }, + "exemplar": true, + "expr": "sum by(deployment)(kube_deployment_status_replicas{namespace=\"$namespace\", deployment=~\"$env-.*-normal\", deployment!=\"$namespace-scheduler-normal\"}) > 0", + "instant": false, + "interval": "", + "legendFormat": "{{deployment}}", + "refId": "B" + } + ], + "title": "Worker count", + "transformations": [ + { + "id": "renameByRegex", + "options": { + "regex": "cayzn-\\w*-\\w*-(.*)-normal", + "renamePattern": "$1" + } + } + ], + "type": "timeseries" + } + ], + "refresh": "", + "schemaVersion": 36, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "Prometheus", + "value": "Prometheus" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": {}, + "datasource": { + "uid": "$datasource" + }, + "definition": "label_values(kube_pod_info, cluster)", + "hide": 2, + "includeAll": false, + "label": "Cluster", + "multi": false, + "name": "cluster", + "options": [], + "query": { + "query": "label_values(kube_pod_info, cluster)", + "refId": "Prometheus-cluster-Variable-Query" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": {}, + "datasource": { + "uid": "$datasource" + }, + "definition": "label_values(remoulade_worker_busy, namespace)", + "hide": 0, + "includeAll": false, + "label": "Namespace", + "multi": false, + "name": "namespace", + "options": [], + "query": { + "query": "label_values(remoulade_worker_busy, namespace)", + "refId": "StandardVariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": {}, + "datasource": { + "uid": "$datasource" + }, + "definition": "label_values(rabbitmq_queue_messages{namespace=\"$namespace\"}, job)", + "hide": 0, + "includeAll": false, + "label": "Env", + "multi": false, + "name": "env", + "options": [], + "query": { + "query": "label_values(rabbitmq_queue_messages{namespace=\"$namespace\"}, job)", + "refId": "StandardVariableQuery" + }, + "refresh": 2, + "regex": "(.*)-(prometheus-rabbitmq-exporter|rabbitmq)", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "hide": 2, + "label": "kibana url", + "name": "kibana_url", + "query": "${VAR_KIBANA_URL}", + "skipUrlSync": false, + "type": "constant", + "current": { + "value": "${VAR_KIBANA_URL}", + "text": "${VAR_KIBANA_URL}", + "selected": false + }, + "options": [ + { + "value": "${VAR_KIBANA_URL}", + "text": "${VAR_KIBANA_URL}", + "selected": false + } + ] + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "browser", + "title": "Remoulade", + "uid": "G2ptb-cGz", + "version": 52, + "weekStart": "" +} \ No newline at end of file diff --git a/docs/source/advanced.rst b/docs/source/advanced.rst index cd7735e82..9928c1b87 100644 --- a/docs/source/advanced.rst +++ b/docs/source/advanced.rst @@ -231,9 +231,9 @@ All metrics define labels for ``queue_name`` and ``actor_name``. Grafana Dashboard ~~~~~~~~~~~~~~~~~ -You can find a Grafana dashboard that displays these metrics here_. +You can find an exported Grafana dashboard that displays these metrics here_. -.. _here: https://grafana.com/dashboards/3692 +.. _here: https://remoulade.readthedocs.io/en/latest/_static/remoulade-dashboard.json Gotchas with Prometheus ~~~~~~~~~~~~~~~~~~~~~~~