From 6d0a7b42dd35df52617d8da7087d6922ccc27e0a Mon Sep 17 00:00:00 2001 From: Silvano Ravotto Date: Mon, 22 Apr 2024 17:37:37 -0400 Subject: [PATCH] Using variable for datasource in example dashboard. Fixes #67 --- examples/dashboard.json | 1144 ++++++++++++++++++++------------------- 1 file changed, 587 insertions(+), 557 deletions(-) diff --git a/examples/dashboard.json b/examples/dashboard.json index 1f6b497..f351d1e 100644 --- a/examples/dashboard.json +++ b/examples/dashboard.json @@ -1,613 +1,643 @@ { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "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" - } - ] + "__inputs": [ + { + "name": "DS_ROACHPROD", + "label": "roachprod", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": [], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "9.0.0" }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 31, - "links": [], - "liveNow": false, - "panels": [ + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ { + "builtIn": 1, "datasource": { - "type": "prometheus", - "uid": "Wt7Ir3J7k" + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_ROACHPROD}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" } }, - "overrides": [] - }, - "gridPos": { - "h": 14, - "w": 11, - "x": 0, - "y": 0 - }, - "id": 4, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single", - "sort": "none" + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] } }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "Wt7Ir3J7k" - }, - "expr": "\nsum(rate(sqlactivity_exec_count[$__rate_interval])) by (statement)\n", - "refId": "A" - } - ], - "title": "QPS per statement", - "type": "timeseries" + "overrides": [] }, - { - "datasource": { - "type": "prometheus", - "uid": "Wt7Ir3J7k" + "gridPos": { + "h": 14, + "w": 11, + "x": 0, + "y": 0 + }, + "id": 4, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_ROACHPROD}" + }, + "expr": "\nsum(rate(sqlactivity_exec_count[$__rate_interval])) by (statement)\n", + "refId": "A" + } + ], + "title": "QPS per statement", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_ROACHPROD}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" }, - "unit": "percent" + "thresholdsStyle": { + "mode": "off" + } }, - "overrides": [] - }, - "gridPos": { - "h": 14, - "w": 11, - "x": 11, - "y": 0 - }, - "id": 8, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "unit": "percent" }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "Wt7Ir3J7k" - }, - "expr": "\nsum by (cluster, statement,db_console) (sqlactivity_run_lat *rate(sqlactivity_exec_count[$__rate_interval]) / on () group_left sum(sqlactivity_run_lat * rate(sqlactivity_exec_count[$__rate_interval])) * 100)\n\n", - "refId": "A" - } - ], - "title": "% Runtime", - "type": "timeseries" + "overrides": [] }, - { - "datasource": { - "type": "prometheus", - "uid": "Wt7Ir3J7k" + "gridPos": { + "h": 14, + "w": 11, + "x": 11, + "y": 0 + }, + "id": 8, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_ROACHPROD}" + }, + "expr": "\nsum by (cluster, statement,db_console) (sqlactivity_run_lat *rate(sqlactivity_exec_count[$__rate_interval]) / on () group_left sum(sqlactivity_run_lat * rate(sqlactivity_exec_count[$__rate_interval])) * 100)\n\n", + "refId": "A" + } + ], + "title": "% Runtime", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_ROACHPROD}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "thresholdsStyle": { + "mode": "off" } }, - "overrides": [] + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } }, - "gridPos": { - "h": 14, - "w": 11, - "x": 0, - "y": 14 + "overrides": [] + }, + "gridPos": { + "h": 14, + "w": 11, + "x": 0, + "y": 14 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_ROACHPROD}" }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "editorMode": "code", + "expr": "sum(rate(sqlefficiency_healtylio[$__rate_interval])) by (cluster,type) ", + "legendFormat": "Healthy Queries", + "range": true, + "refId": "A" }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "Wt7Ir3J7k" - }, - "editorMode": "code", - "expr": "sum(rate(sqlefficiency_healtylio[$__rate_interval])) by (cluster,type) ", - "legendFormat": "Healthy Queries", - "range": true, - "refId": "A" + { + "datasource": { + "type": "prometheus", + "uid": "${DS_ROACHPROD}" }, - { - "datasource": { - "type": "prometheus", - "uid": "Wt7Ir3J7k" - }, - "editorMode": "code", - "expr": "sum(rate(sqlefficiency_explicitlio[$__rate_interval])) by (cluster,type) ", - "hide": false, - "legendFormat": "Explicit Queries", - "range": true, - "refId": "B" + "editorMode": "code", + "expr": "sum(rate(sqlefficiency_explicitlio[$__rate_interval])) by (cluster,type) ", + "hide": false, + "legendFormat": "Explicit Queries", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_ROACHPROD}" }, - { - "datasource": { - "type": "prometheus", - "uid": "Wt7Ir3J7k" - }, - "editorMode": "code", - "expr": "sum(rate(sqlefficiency_fulllio[$__rate_interval])) by (cluster,type) ", - "hide": false, - "legendFormat": "Queries with Full Scans", - "range": true, - "refId": "C" + "editorMode": "code", + "expr": "sum(rate(sqlefficiency_fulllio[$__rate_interval])) by (cluster,type) ", + "hide": false, + "legendFormat": "Queries with Full Scans", + "range": true, + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_ROACHPROD}" }, - { - "datasource": { - "type": "prometheus", - "uid": "Wt7Ir3J7k" - }, - "editorMode": "code", - "expr": "sum(rate(sqlefficiency_ijoinlio[$__rate_interval])) by (cluster,type) ", - "hide": false, - "legendFormat": "Queries with Index Joins", - "range": true, - "refId": "D" - } - ], - "title": "SQL Efficiency - Rows per type", - "type": "timeseries" + "editorMode": "code", + "expr": "sum(rate(sqlefficiency_ijoinlio[$__rate_interval])) by (cluster,type) ", + "hide": false, + "legendFormat": "Queries with Index Joins", + "range": true, + "refId": "D" + } + ], + "title": "SQL Efficiency - Rows per type", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_ROACHPROD}" }, - { - "datasource": { - "type": "prometheus", - "uid": "Wt7Ir3J7k" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" } }, - "overrides": [] - }, - "gridPos": { - "h": 14, - "w": 11, - "x": 11, - "y": 14 - }, - "id": 6, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single", - "sort": "none" + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] } }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "Wt7Ir3J7k" - }, - "expr": "max(increase(contended_tables_num_events[$__rate_interval])) by (cluster,table_name) ", - "refId": "A" - } - ], - "title": "Contended Tables", - "type": "timeseries" + "overrides": [] }, - { - "datasource": { - "type": "prometheus", - "uid": "Wt7Ir3J7k" + "gridPos": { + "h": 14, + "w": 11, + "x": 11, + "y": 14 + }, + "id": 6, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_ROACHPROD}" + }, + "expr": "max(increase(contended_tables_num_events[$__rate_interval])) by (cluster,table_name) ", + "refId": "A" + } + ], + "title": "Contended Tables", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_ROACHPROD}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "thresholdsStyle": { + "mode": "off" } }, - "overrides": [] - }, - "gridPos": { - "h": 14, - "w": 11, - "x": 0, - "y": 28 - }, - "id": 5, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single", - "sort": "none" + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] } }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "Wt7Ir3J7k" - }, - "expr": "max(increase(intent_count[$__rate_interval])) by (cluster,table_name) ", - "refId": "A" - } - ], - "title": "Intents per table", - "type": "timeseries" + "overrides": [] }, - { - "datasource": { - "type": "prometheus", - "uid": "Wt7Ir3J7k" + "gridPos": { + "h": 14, + "w": 11, + "x": 0, + "y": 28 + }, + "id": 5, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_ROACHPROD}" + }, + "expr": "max(increase(intent_count[$__rate_interval])) by (cluster,table_name) ", + "refId": "A" + } + ], + "title": "Intents per table", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_ROACHPROD}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "custom": { - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] + "thresholdsStyle": { + "mode": "off" } }, - "overrides": [] + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } }, - "gridPos": { - "h": 14, - "w": 11, - "x": 11, - "y": 28 + "overrides": [] + }, + "gridPos": { + "h": 14, + "w": 11, + "x": 11, + "y": 28 + }, + "id": 7, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" }, - "id": 7, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_ROACHPROD}" }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "Wt7Ir3J7k" - }, - "editorMode": "code", - "expr": "max(increase(blocking_statements_count[$__rate_interval])) by (cluster,statement_id) ", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "Blocking Statements", - "type": "timeseries" - } - ], - "refresh": false, - "schemaVersion": 36, - "style": "dark", - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "2022-10-31T19:45:16.385Z", - "to": "2022-10-31T20:38:52.628Z" - }, - "timepicker": {}, - "timezone": "", - "title": "Visus", - "uid": "EK39EoHVz", - "version": 5, - "weekStart": "" - } - \ No newline at end of file + "editorMode": "code", + "expr": "max(increase(blocking_statements_count[$__rate_interval])) by (cluster,statement_id) ", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Blocking Statements", + "type": "timeseries" + } + ], + "refresh": false, + "schemaVersion": 36, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "2022-10-31T19:45:16.385Z", + "to": "2022-10-31T20:38:52.628Z" + }, + "timepicker": {}, + "timezone": "", + "title": "Visus", + "uid": "EK39EoHVz", + "version": 1, + "weekStart": "" +} \ No newline at end of file