From bb3426ee8471d210610b7cde222ff8cab558050d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Guzm=C3=A1n=20Burgos?= <7537643+nethalo@users.noreply.github.com> Date: Thu, 22 Feb 2024 10:18:51 -0500 Subject: [PATCH] Create databases_overview.json --- .../Experimental/databases_overview.json | 1099 +++++++++++++++++ 1 file changed, 1099 insertions(+) create mode 100644 dashboards/Experimental/databases_overview.json diff --git a/dashboards/Experimental/databases_overview.json b/dashboards/Experimental/databases_overview.json new file mode 100644 index 0000000000..73c1c1f1dd --- /dev/null +++ b/dashboards/Experimental/databases_overview.json @@ -0,0 +1,1099 @@ +{ + "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" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, + "id": 78, + "links": [ + { + "asDropdown": false, + "icon": "doc", + "includeVars": true, + "keepTime": true, + "tags": [], + "targetBlank": false, + "title": "Home", + "tooltip": "", + "type": "link", + "url": "/graph/d/pmm-home/home-dashboard" + }, + { + "asDropdown": false, + "icon": "dashboard", + "includeVars": true, + "keepTime": true, + "tags": [], + "targetBlank": false, + "title": "Query Analytics", + "tooltip": "", + "type": "link", + "url": "/graph/d/pmm-qan/pmm-query-analytics" + }, + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": true, + "tags": [ + "Services" + ], + "targetBlank": false, + "title": "Services", + "tooltip": "", + "type": "dashboards", + "url": "" + }, + { + "asDropdown": true, + "icon": "external link", + "includeVars": false, + "keepTime": true, + "tags": [ + "PMM" + ], + "targetBlank": false, + "title": "PMM", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "PA58DA793C7250F1B" + }, + "gridPos": { + "h": 3, + "w": 5, + "x": 0, + "y": 0 + }, + "id": 1083, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "
${srvcnt} ${service_type}
Databases monitored
", + "mode": "html" + }, + "pluginVersion": "9.2.20", + "transparent": true, + "type": "text" + }, + { + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "super-light-yellow", + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 31, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 10, + "x": 5, + "y": 0 + }, + "id": 1077, + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "9.2.20", + "targets": [ + { + "builderOptions": { + "database": "pmm", + "fields": [], + "filters": [ + { + "condition": "AND", + "filterType": "custom", + "key": "period_start", + "operator": "WITH IN DASHBOARD TIME RANGE", + "restrictToFields": [ + { + "label": "period_start", + "name": "period_start", + "picklistValues": [], + "type": "DateTime" + } + ], + "type": "datetime" + } + ], + "groupBy": [ + "period_start", + "service_name" + ], + "limit": 10000, + "metrics": [ + { + "aggregation": "avg", + "alias": "\"Execution time\"", + "field": "m_query_time_sum" + } + ], + "mode": "aggregate", + "orderBy": [ + { + "dir": "ASC", + "name": "period_start" + } + ], + "table": "metrics", + "timeField": "period_start", + "timeFieldType": "DateTime" + }, + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "format": 0, + "hide": true, + "meta": { + "builderOptions": { + "database": "pmm", + "fields": [], + "filters": [ + { + "condition": "AND", + "filterType": "custom", + "key": "period_start", + "operator": "WITH IN DASHBOARD TIME RANGE", + "restrictToFields": [ + { + "label": "period_start", + "name": "period_start", + "picklistValues": [], + "type": "DateTime" + } + ], + "type": "datetime" + } + ], + "groupBy": [ + "period_start", + "service_name" + ], + "limit": 10000, + "metrics": [ + { + "aggregation": "avg", + "alias": "\"Execution time\"", + "field": "m_query_time_sum" + } + ], + "mode": "aggregate", + "orderBy": [ + { + "dir": "ASC", + "name": "period_start" + } + ], + "table": "metrics", + "timeField": "period_start", + "timeFieldType": "DateTime" + } + }, + "queryType": "sql", + "rawSql": "SELECT period_start, service_name, avg(m_query_time_sum) \"Execution_time\" FROM pmm.\"metrics\" WHERE ( period_start >= $__fromTime AND period_start <= $__toTime ) and service_type like '%$service_type%' GROUP BY period_start, service_name ORDER BY period_start ASC LIMIT 10000", + "refId": "A", + "selectedFormat": 0 + }, + { + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "hide": false, + "meta": { + "builderOptions": { + "fields": [], + "limit": 100, + "mode": "list" + } + }, + "queryType": "sql", + "rawSql": "SELECT period_start, service_name, avg(m_query_time_sum/m_query_time_cnt) \"Execution_time\"\nFROM pmm.\"metrics\" WHERE ( period_start >= $__fromTime AND period_start <= $__toTime ) and service_type like '%$service_type%' GROUP BY period_start, service_name ORDER BY period_start ASC ", + "refId": "B" + } + ], + "title": "Execution time", + "transformations": [], + "transparent": true, + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PA58DA793C7250F1B" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "purple", + "mode": "continuous-BlYlRd" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 15, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 1, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 9, + "x": 15, + "y": 0 + }, + "id": 1085, + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "9.2.20", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PA58DA793C7250F1B" + }, + "editorMode": "code", + "expr": "topk(5, avg by (service_name) (irate(mysql_global_status_questions{service_type=~\"$service_type\"})))", + "legendFormat": "__auto", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PA58DA793C7250F1B" + }, + "editorMode": "code", + "expr": "topk(5, avg by (service_name) (rate(pg_stat_database_xact_commit{service_type=~\"$service_type\"}[$interval])))", + "hide": false, + "legendFormat": "__auto", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PA58DA793C7250F1B" + }, + "editorMode": "code", + "expr": "topk(5, avg by (service_name) (rate(mongodb_op_counters_total{service_type=~\"$service_type\",type!=\"command\"}[$interval])))", + "hide": false, + "legendFormat": "__auto", + "range": true, + "refId": "C" + } + ], + "title": "Executed Queries", + "transformations": [], + "transparent": true, + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PA58DA793C7250F1B" + }, + "description": "*Not real time. QAN is expected to have some minutes of lag", + "gridPos": { + "h": 3, + "w": 5, + "x": 0, + "y": 3 + }, + "id": 1079, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "
${slowq} Queries slower than ${qthres} sec(s) in the last ${rangeCustom} minutes*\n
", + "mode": "html" + }, + "pluginVersion": "9.2.20", + "transparent": true, + "type": "text" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PA58DA793C7250F1B" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "dark-blue", + "mode": "fixed" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 5, + "x": 0, + "y": 6 + }, + "id": 1087, + "options": { + "displayMode": "basic", + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "min" + ], + "fields": "", + "values": false + }, + "showUnfilled": true + }, + "pluginVersion": "9.2.20", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PA58DA793C7250F1B" + }, + "editorMode": "code", + "exemplar": false, + "expr": "bottomk(3,range_last(mysql_global_status_uptime{service_type=\"$service_type\"}[30s]))", + "format": "time_series", + "hide": false, + "instant": false, + "legendFormat": "{{service_name}}", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PA58DA793C7250F1B" + }, + "editorMode": "code", + "expr": "bottomk(3,range_last(pg_postmaster_uptime_seconds{service_type=\"$service_type\"}[30s]))", + "hide": false, + "legendFormat": "{{service_name}}", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PA58DA793C7250F1B" + }, + "editorMode": "code", + "expr": "bottomk(3,range_last(mongodb_instance_uptime_seconds{service_type=\"$service_type\"}[30s]))", + "hide": false, + "legendFormat": "{{service_name}}", + "range": true, + "refId": "C" + } + ], + "title": "Lowest Uptime (top 3)", + "transparent": true, + "type": "bargauge" + }, + { + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd" + }, + "custom": { + "align": "auto", + "displayMode": "auto", + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "time" + }, + "properties": [ + { + "id": "custom.width", + "value": 202 + }, + { + "id": "custom.displayMode", + "value": "color-background-solid" + }, + { + "id": "custom.align", + "value": "center" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Service" + }, + "properties": [ + { + "id": "custom.width", + "value": 220 + }, + { + "id": "custom.align", + "value": "center" + }, + { + "id": "custom.filterable", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Query" + }, + "properties": [ + { + "id": "custom.inspect", + "value": true + }, + { + "id": "custom.width", + "value": 832 + }, + { + "id": "custom.filterable", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Execution_time" + }, + "properties": [ + { + "id": "custom.align", + "value": "center" + }, + { + "id": "custom.displayMode", + "value": "basic" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "fingerprint" + }, + "properties": [ + { + "id": "custom.width", + "value": 704 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "username" + }, + "properties": [ + { + "id": "custom.width", + "value": 86 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 1065, + "options": { + "footer": { + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Execution_time" + } + ] + }, + "pluginVersion": "9.2.20", + "targets": [ + { + "builderOptions": { + "database": "pmm", + "fields": [ + "fingerprint", + "service_name" + ], + "filters": [ + { + "condition": "AND", + "filterType": "custom", + "key": "period_start", + "operator": "WITH IN DASHBOARD TIME RANGE", + "restrictToFields": [ + { + "label": "period_start", + "name": "period_start", + "picklistValues": [], + "type": "DateTime" + } + ], + "type": "datetime" + }, + { + "condition": "AND", + "filterType": "custom", + "key": "service_type", + "operator": "LIKE", + "type": "LowCardinality(String)", + "value": "$service_type" + } + ], + "groupBy": [ + "period_start", + "service_name", + "fingerprint", + "m_query_time_sum" + ], + "limit": 10, + "metrics": [ + { + "aggregation": "avg", + "alias": "\"Execution time\"", + "field": "m_query_time_sum" + } + ], + "mode": "trend", + "orderBy": [ + { + "dir": "ASC", + "name": "period_start" + } + ], + "table": "metrics", + "timeField": "period_start", + "timeFieldType": "DateTime" + }, + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "format": 1, + "hide": false, + "meta": { + "builderOptions": { + "database": "pmm", + "fields": [ + "fingerprint", + "service_name" + ], + "filters": [ + { + "condition": "AND", + "filterType": "custom", + "key": "period_start", + "operator": "WITH IN DASHBOARD TIME RANGE", + "restrictToFields": [ + { + "label": "period_start", + "name": "period_start", + "picklistValues": [], + "type": "DateTime" + } + ], + "type": "datetime" + }, + { + "condition": "AND", + "filterType": "custom", + "key": "service_type", + "operator": "LIKE", + "type": "LowCardinality(String)", + "value": "$service_type" + } + ], + "groupBy": [ + "period_start", + "service_name", + "fingerprint", + "m_query_time_sum" + ], + "limit": 10, + "metrics": [ + { + "aggregation": "avg", + "alias": "\"Execution time\"", + "field": "m_query_time_sum" + } + ], + "mode": "trend", + "orderBy": [ + { + "dir": "ASC", + "name": "period_start" + } + ], + "table": "metrics", + "timeField": "period_start", + "timeFieldType": "DateTime" + } + }, + "queryType": "sql", + "rawSql": "SELECT $__timeInterval(period_start) as time, service_name \"Service\", username, fingerprint \"Query\", avg(m_query_time_sum/m_query_time_cnt) \"Execution_time\" FROM pmm.\"metrics\" WHERE ( period_start >= $__fromTime AND period_start <= $__toTime ) AND ( service_type LIKE '%$service_type%' ) GROUP BY service_name, username, fingerprint , m_query_time_sum, time ORDER BY time DESC LIMIT 10000", + "refId": "A", + "selectedFormat": 1 + } + ], + "title": "Queries", + "transformations": [], + "transparent": true, + "type": "table" + } + ], + "refresh": "30s", + "schemaVersion": 37, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allFormat": "glob", + "auto": true, + "auto_count": 200, + "auto_min": "1s", + "current": { + "selected": false, + "text": "auto", + "value": "$__auto_interval_interval" + }, + "datasource": "Metrics", + "hide": 0, + "includeAll": false, + "label": "Interval", + "multi": false, + "multiFormat": "glob", + "name": "interval", + "options": [ + { + "selected": true, + "text": "auto", + "value": "$__auto_interval_interval" + }, + { + "selected": false, + "text": "1s", + "value": "1s" + }, + { + "selected": false, + "text": "5s", + "value": "5s" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "5m", + "value": "5m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + } + ], + "query": "1s,5s,1m,5m,1h,6h,1d", + "queryValue": "", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" + }, + { + "current": { + "selected": false, + "text": "mysql", + "value": "mysql" + }, + "datasource": { + "type": "prometheus", + "uid": "PA58DA793C7250F1B" + }, + "definition": "label_values({__name__=~\"pg_up|mysql_up|mongodb_up|proxysql_mysql_status_active_transactions\"}, service_type)", + "hide": 0, + "includeAll": false, + "label": "Engine", + "multi": false, + "name": "service_type", + "options": [], + "query": { + "query": "label_values({__name__=~\"pg_up|mysql_up|mongodb_up|proxysql_mysql_status_active_transactions\"}, service_type)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "/.*^(mysql|postgresql|mongodb)/", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": true, + "text": "0.100", + "value": "0.100" + }, + "hide": 0, + "includeAll": false, + "label": "Query Time", + "multi": false, + "name": "qthres", + "options": [ + { + "selected": false, + "text": "0.001", + "value": "0.001" + }, + { + "selected": false, + "text": "0.010", + "value": "0.010" + }, + { + "selected": true, + "text": "0.100", + "value": "0.100" + }, + { + "selected": false, + "text": "1", + "value": "1" + }, + { + "selected": false, + "text": "10", + "value": "10" + } + ], + "query": "0.001,0.010,0.100,1,10", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + }, + { + "current": { + "selected": false, + "text": "151", + "value": "151" + }, + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "definition": "SELECT count(*)\n FROM pmm.metrics\n WHERE service_type = '${service_type}'\n AND ( period_start >= $__fromTime AND period_start <= $__toTime )\n AND m_query_time_sum/m_query_time_cnt > ${qthres}", + "hide": 2, + "includeAll": false, + "label": "slowq", + "multi": false, + "name": "slowq", + "options": [], + "query": "SELECT count(*)\n FROM pmm.metrics\n WHERE service_type = '${service_type}'\n AND ( period_start >= $__fromTime AND period_start <= $__toTime )\n AND m_query_time_sum/m_query_time_cnt > ${qthres}", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "10", + "value": "10" + }, + "datasource": { + "type": "postgres", + "uid": "PCC52D03280B7034C" + }, + "definition": "select count(*) from services where service_type = '${service_type}';", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "srvcnt", + "options": [], + "query": "select count(*) from services where service_type = '${service_type}';", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "15", + "value": "15" + }, + "datasource": { + "type": "grafana-clickhouse-datasource", + "uid": "PDEE91DDB90597936" + }, + "definition": "select ($__toTime - $__fromTime)/60", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "rangeCustom", + "options": [], + "query": "select ($__toTime - $__fromTime)/60", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-15m", + "to": "now" + }, + "timepicker": { + "collapse": false, + "enable": true, + "hidden": false, + "notice": false, + "now": true, + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "status": "Stable", + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ], + "type": "timepicker" + }, + "timezone": "", + "title": "Databases Overview", + "uid": "ywQr8WtSk", + "version": 33, + "weekStart": "" +}