Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dashboard for single stat panel #681

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
284 changes: 284 additions & 0 deletions docker/grafana/dashboards/single_stat_panel_403.json
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": ""
}
Loading