-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #681 from Altinity/issue-403
Add dashboard for single stat panel
- Loading branch information
Showing
1 changed file
with
284 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,284 @@ | ||
{ | ||
"annotations": { | ||
"list": [ | ||
{ | ||
"builtIn": 1, | ||
"datasource": { | ||
"type": "grafana", | ||
"uid": "-- Grafana --" | ||
}, | ||
"enable": true, | ||
"hide": true, | ||
"iconColor": "rgba(0, 211, 255, 1)", | ||
"name": "Annotations & Alerts", | ||
"type": "dashboard" | ||
} | ||
] | ||
}, | ||
"description": "https://github.com/Altinity/clickhouse-grafana/issues/403", | ||
"editable": true, | ||
"fiscalYearStartMonth": 0, | ||
"graphTooltip": 0, | ||
"id": 45, | ||
"links": [], | ||
"panels": [ | ||
{ | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"description": "https://github.com/Altinity/clickhouse-grafana/issues/403", | ||
"fieldConfig": { | ||
"defaults": { | ||
"color": { | ||
"mode": "thresholds" | ||
}, | ||
"mappings": [], | ||
"thresholds": { | ||
"mode": "absolute", | ||
"steps": [ | ||
{ | ||
"color": "green", | ||
"value": null | ||
}, | ||
{ | ||
"color": "red", | ||
"value": 80 | ||
} | ||
] | ||
} | ||
}, | ||
"overrides": [] | ||
}, | ||
"gridPos": { | ||
"h": 8, | ||
"w": 12, | ||
"x": 0, | ||
"y": 0 | ||
}, | ||
"id": 1, | ||
"options": { | ||
"colorMode": "background", | ||
"graphMode": "area", | ||
"justifyMode": "center", | ||
"orientation": "auto", | ||
"percentChangeColorMode": "standard", | ||
"reduceOptions": { | ||
"calcs": [ | ||
"lastNotNull" | ||
], | ||
"fields": "", | ||
"values": false | ||
}, | ||
"showPercentChange": false, | ||
"textMode": "value_and_name", | ||
"wideLayout": true | ||
}, | ||
"pluginVersion": "11.3.0+security-01", | ||
"targets": [ | ||
{ | ||
"adHocFilters": [], | ||
"adHocValuesQuery": "", | ||
"add_metadata": true, | ||
"contextWindowSize": "10", | ||
"database": "default", | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"editorMode": "sql", | ||
"extrapolate": true, | ||
"format": "time_series", | ||
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | ||
"interval": "", | ||
"intervalFactor": 1, | ||
"query": "SELECT\n 1 AS t,\n concat('Category ', toString(cat)) AS cat,\n count(idx) AS errors\nFROM (\n SELECT\n rand() % 4 + 1 AS cat, /* Random category */\n rand() % 100 AS idx /* Random idx values */\n FROM numbers(1000) /* More rows for higher variability */\n) subquery\nGROUP BY t, cat limit 1", | ||
"rawQuery": "/* grafana dashboard=Stat panels, user=0 */\nSELECT\n 1 AS t,\n concat('Category ', toString(cat)) AS cat,\n count(idx) AS errors\nFROM (\n SELECT\n rand() % 4 + 1 AS cat, \n rand() % 100 AS idx \n FROM numbers(1000) \n) subquery\nGROUP BY t, cat limit", | ||
"refId": "A", | ||
"round": "0s", | ||
"skip_comments": true, | ||
"table": "test_grafana" | ||
} | ||
], | ||
"title": "Single stat panel #403", | ||
"type": "stat" | ||
}, | ||
{ | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"description": "https://github.com/Altinity/clickhouse-grafana/issues/403", | ||
"fieldConfig": { | ||
"defaults": { | ||
"color": { | ||
"mode": "thresholds" | ||
}, | ||
"mappings": [], | ||
"thresholds": { | ||
"mode": "absolute", | ||
"steps": [ | ||
{ | ||
"color": "green", | ||
"value": null | ||
}, | ||
{ | ||
"color": "red", | ||
"value": 80 | ||
} | ||
] | ||
} | ||
}, | ||
"overrides": [] | ||
}, | ||
"gridPos": { | ||
"h": 8, | ||
"w": 12, | ||
"x": 12, | ||
"y": 0 | ||
}, | ||
"id": 2, | ||
"options": { | ||
"colorMode": "background", | ||
"graphMode": "area", | ||
"justifyMode": "center", | ||
"orientation": "auto", | ||
"percentChangeColorMode": "standard", | ||
"reduceOptions": { | ||
"calcs": [ | ||
"lastNotNull" | ||
], | ||
"fields": "", | ||
"values": false | ||
}, | ||
"showPercentChange": false, | ||
"textMode": "value_and_name", | ||
"wideLayout": true | ||
}, | ||
"pluginVersion": "11.3.0+security-01", | ||
"targets": [ | ||
{ | ||
"adHocFilters": [], | ||
"adHocValuesQuery": "", | ||
"add_metadata": true, | ||
"contextWindowSize": "10", | ||
"database": "default", | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"editorMode": "sql", | ||
"extrapolate": true, | ||
"format": "time_series", | ||
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | ||
"interval": "", | ||
"intervalFactor": 1, | ||
"query": "SELECT\n 1 AS t,\n concat('Category ', toString(cat)) AS cat,\n count(idx) AS errors\nFROM (\n SELECT\n rand() % 10 + 1 AS cat, /* Random category */\n rand() % 100 AS idx /* Random idx values */\n FROM numbers(1000) /* More rows for higher variability */\n) subquery\nGROUP BY t, cat", | ||
"rawQuery": "/* grafana dashboard=Stat panels, user=0 */\nSELECT\n 1 AS t,\n concat('Category ', toString(cat)) AS cat,\n count(idx) AS errors\nFROM (\n SELECT\n rand() % 10 + 1 AS cat, \n rand() % 10 AS idx \n FROM numbers(1000) \n) subquery\nGROUP BY t, cat", | ||
"refId": "A", | ||
"round": "0s", | ||
"skip_comments": true, | ||
"table": "test_grafana" | ||
} | ||
], | ||
"title": "Stat panel", | ||
"type": "stat" | ||
}, | ||
{ | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"description": "https://github.com/Altinity/clickhouse-grafana/issues/403", | ||
"fieldConfig": { | ||
"defaults": { | ||
"color": { | ||
"mode": "thresholds" | ||
}, | ||
"mappings": [], | ||
"thresholds": { | ||
"mode": "absolute", | ||
"steps": [ | ||
{ | ||
"color": "green", | ||
"value": null | ||
}, | ||
{ | ||
"color": "red", | ||
"value": 80 | ||
} | ||
] | ||
} | ||
}, | ||
"overrides": [] | ||
}, | ||
"gridPos": { | ||
"h": 8, | ||
"w": 12, | ||
"x": 0, | ||
"y": 8 | ||
}, | ||
"id": 3, | ||
"options": { | ||
"colorMode": "background", | ||
"graphMode": "area", | ||
"justifyMode": "center", | ||
"orientation": "horizontal", | ||
"percentChangeColorMode": "standard", | ||
"reduceOptions": { | ||
"calcs": [ | ||
"lastNotNull" | ||
], | ||
"fields": "", | ||
"values": false | ||
}, | ||
"showPercentChange": false, | ||
"textMode": "value_and_name", | ||
"wideLayout": true | ||
}, | ||
"pluginVersion": "11.3.0+security-01", | ||
"targets": [ | ||
{ | ||
"adHocFilters": [], | ||
"adHocValuesQuery": "", | ||
"add_metadata": true, | ||
"contextWindowSize": "10", | ||
"database": "default", | ||
"datasource": { | ||
"type": "vertamedia-clickhouse-datasource", | ||
"uid": "P7E099F39B84EA795" | ||
}, | ||
"editorMode": "sql", | ||
"extrapolate": true, | ||
"format": "time_series", | ||
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t", | ||
"interval": "", | ||
"intervalFactor": 1, | ||
"query": "SELECT\n 1 AS t,\n concat('Category ', toString(cat)) AS cat,\n count(idx) AS errors\nFROM (\n SELECT\n rand() % 4 + 1 AS cat, /* Random category */\n rand() % 100 AS idx /* Random idx values */\n FROM numbers(1000) /* More rows for higher variability */\n) subquery\nGROUP BY t, cat", | ||
"rawQuery": "/* grafana dashboard=Stat panels, user=0 */\nSELECT\n 1 AS t,\n concat('Category ', toString(cat)) AS cat,\n count(idx) AS errors\nFROM (\n SELECT\n rand() % 4 + 1 AS cat, \n rand() % 100 AS idx \n FROM numbers(1000) \n) subquery\nGROUP BY t, cat", | ||
"refId": "A", | ||
"round": "0s", | ||
"skip_comments": true, | ||
"table": "test_grafana" | ||
} | ||
], | ||
"title": "Stat panel", | ||
"type": "stat" | ||
} | ||
], | ||
"schemaVersion": 40, | ||
"tags": [], | ||
"templating": { | ||
"list": [] | ||
}, | ||
"time": { | ||
"from": "now-6h", | ||
"to": "now" | ||
}, | ||
"timepicker": {}, | ||
"timezone": "browser", | ||
"title": "Stat panels", | ||
"uid": "ce5y2zqopdwqoa", | ||
"version": 5, | ||
"weekStart": "" | ||
} |