grafana: add system usage, break up into rows

This commit is contained in:
Alex Gleason 2024-09-08 13:31:09 -05:00
parent ca1455c59a
commit 9331ab4ac1
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -19,6 +19,12 @@
], ],
"__elements": {}, "__elements": {},
"__requires": [ "__requires": [
{
"type": "panel",
"id": "bargauge",
"name": "Bar gauge",
"version": ""
},
{ {
"type": "panel", "type": "panel",
"id": "gauge", "id": "gauge",
@ -29,7 +35,7 @@
"type": "grafana", "type": "grafana",
"id": "grafana", "id": "grafana",
"name": "Grafana", "name": "Grafana",
"version": "11.2.0" "version": "11.1.4"
}, },
{ {
"type": "datasource", "type": "datasource",
@ -85,6 +91,19 @@
"id": null, "id": null,
"links": [], "links": [],
"panels": [ "panels": [
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 22,
"panels": [],
"title": "Overview",
"type": "row"
},
{ {
"datasource": { "datasource": {
"default": false, "default": false,
@ -104,7 +123,6 @@
"axisLabel": "", "axisLabel": "",
"axisPlacement": "auto", "axisPlacement": "auto",
"barAlignment": 0, "barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line", "drawStyle": "line",
"fillOpacity": 25, "fillOpacity": 25,
"gradientMode": "none", "gradientMode": "none",
@ -212,7 +230,7 @@
"h": 10, "h": 10,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 0 "y": 1
}, },
"id": 10, "id": 10,
"options": { "options": {
@ -327,7 +345,7 @@
"h": 8, "h": 8,
"w": 6, "w": 6,
"x": 0, "x": 0,
"y": 10 "y": 11
}, },
"id": 8, "id": 8,
"options": { "options": {
@ -345,7 +363,7 @@
"showThresholdMarkers": true, "showThresholdMarkers": true,
"sizing": "auto" "sizing": "auto"
}, },
"pluginVersion": "11.2.0", "pluginVersion": "11.1.4",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -368,52 +386,15 @@
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "${DS_PROMETHEUS}"
}, },
"description": "How hard the database is working on a per-query basis. It's query time divided by number of queries. Lower is better.", "description": "Usage of system resources.",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"color": { "color": {
"fixedColor": "red", "mode": "continuous-GrYlRd"
"mode": "continuous-GrYlRd",
"seriesBy": "last"
}, },
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "scheme",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"fieldMinMax": false,
"mappings": [], "mappings": [],
"max": 100,
"min": 0,
"thresholds": { "thresholds": {
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
@ -426,47 +407,66 @@
"value": 80 "value": 80
} }
] ]
} },
"unit": "percent"
}, },
"overrides": [] "overrides": []
}, },
"gridPos": { "gridPos": {
"h": 8, "h": 5,
"w": 12, "w": 12,
"x": 6, "x": 6,
"y": 10 "y": 11
}, },
"id": 11, "id": 20,
"options": { "options": {
"legend": { "displayMode": "lcd",
"calcs": [], "maxVizHeight": 300,
"displayMode": "list", "minVizHeight": 16,
"placement": "bottom", "minVizWidth": 8,
"showLegend": false "namePlacement": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
}, },
"tooltip": { "showUnfilled": true,
"maxHeight": 600, "sizing": "auto",
"mode": "single", "valueMode": "color"
"sort": "none"
}
}, },
"pluginVersion": "11.1.4",
"targets": [ "targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "100 * (1 - avg(rate(node_cpu_seconds_total{mode=\"idle\"}[$__rate_interval])))",
"instant": false,
"legendFormat": "CPU",
"range": true,
"refId": "A"
},
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${prometheus}" "uid": "${prometheus}"
}, },
"editorMode": "code", "editorMode": "code",
"expr": "rate(ditto_db_query_duration_ms_sum[$__rate_interval]) / rate(ditto_db_queries_total[$__rate_interval])", "expr": "(1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)) * 100",
"hide": false,
"instant": false, "instant": false,
"interval": "", "legendFormat": "RAM",
"legendFormat": "Effort",
"range": true, "range": true,
"refId": "A" "refId": "B"
} }
], ],
"title": "Database Effort", "title": "System Usage",
"type": "timeseries" "type": "bargauge"
}, },
{ {
"datasource": { "datasource": {
@ -486,7 +486,6 @@
"axisLabel": "", "axisLabel": "",
"axisPlacement": "auto", "axisPlacement": "auto",
"barAlignment": 0, "barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line", "drawStyle": "line",
"fillOpacity": 0, "fillOpacity": 0,
"gradientMode": "none", "gradientMode": "none",
@ -533,7 +532,7 @@
"h": 8, "h": 8,
"w": 6, "w": 6,
"x": 18, "x": 18,
"y": 10 "y": 11
}, },
"id": 6, "id": 6,
"options": { "options": {
@ -566,6 +565,103 @@
"title": "Database Queries", "title": "Database Queries",
"type": "timeseries" "type": "timeseries"
}, },
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "Total number of Nostr clients currently connected to the Nostr relay.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 11,
"w": 12,
"x": 6,
"y": 16
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": false
},
"tooltip": {
"maxHeight": 600,
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "ditto_relay_connections",
"instant": false,
"legendFormat": "Connections",
"range": true,
"refId": "A"
}
],
"title": "Relay Connections",
"type": "timeseries"
},
{ {
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
@ -584,7 +680,6 @@
"axisLabel": "", "axisLabel": "",
"axisPlacement": "auto", "axisPlacement": "auto",
"barAlignment": 0, "barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line", "drawStyle": "line",
"fillOpacity": 10, "fillOpacity": 10,
"gradientMode": "none", "gradientMode": "none",
@ -662,7 +757,7 @@
"h": 8, "h": 8,
"w": 6, "w": 6,
"x": 0, "x": 0,
"y": 18 "y": 19
}, },
"id": 12, "id": 12,
"options": { "options": {
@ -708,105 +803,6 @@
"title": "Policy Events", "title": "Policy Events",
"type": "timeseries" "type": "timeseries"
}, },
{
"datasource": {
"default": false,
"type": "prometheus",
"uid": "${prometheus}"
},
"description": "Total number of Nostr clients currently connected to the Nostr relay.",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 6,
"y": 18
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": false
},
"tooltip": {
"maxHeight": 600,
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "ditto_relay_connections",
"instant": false,
"legendFormat": "Connections",
"range": true,
"refId": "A"
}
],
"title": "Relay Connections",
"type": "timeseries"
},
{ {
"datasource": { "datasource": {
"default": false, "default": false,
@ -826,7 +822,6 @@
"axisLabel": "", "axisLabel": "",
"axisPlacement": "auto", "axisPlacement": "auto",
"barAlignment": 0, "barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line", "drawStyle": "line",
"fillOpacity": 0, "fillOpacity": 0,
"gradientMode": "none", "gradientMode": "none",
@ -874,7 +869,7 @@
"h": 8, "h": 8,
"w": 6, "w": 6,
"x": 18, "x": 18,
"y": 18 "y": 19
}, },
"id": 7, "id": 7,
"options": { "options": {
@ -907,6 +902,19 @@
"title": "Database Query Time", "title": "Database Query Time",
"type": "timeseries" "type": "timeseries"
}, },
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 27
},
"id": 21,
"panels": [],
"title": "Database",
"type": "row"
},
{ {
"datasource": { "datasource": {
"default": false, "default": false,
@ -1084,7 +1092,7 @@
"h": 11, "h": 11,
"w": 15, "w": 15,
"x": 0, "x": 0,
"y": 26 "y": 28
}, },
"id": 13, "id": 13,
"options": { "options": {
@ -1106,7 +1114,7 @@
} }
] ]
}, },
"pluginVersion": "11.2.0", "pluginVersion": "11.1.4",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -1240,7 +1248,7 @@
"h": 11, "h": 11,
"w": 9, "w": 9,
"x": 15, "x": 15,
"y": 26 "y": 28
}, },
"id": 14, "id": 14,
"options": { "options": {
@ -1255,7 +1263,7 @@
}, },
"showHeader": true "showHeader": true
}, },
"pluginVersion": "11.2.0", "pluginVersion": "11.1.4",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -1317,7 +1325,7 @@
"h": 9, "h": 9,
"w": 7, "w": 7,
"x": 0, "x": 0,
"y": 37 "y": 39
}, },
"id": 16, "id": 16,
"options": { "options": {
@ -1414,7 +1422,7 @@
"h": 9, "h": 9,
"w": 8, "w": 8,
"x": 7, "x": 7,
"y": 37 "y": 39
}, },
"id": 17, "id": 17,
"options": { "options": {
@ -1579,7 +1587,7 @@
"h": 9, "h": 9,
"w": 9, "w": 9,
"x": 15, "x": 15,
"y": 37 "y": 39
}, },
"id": 18, "id": 18,
"options": { "options": {
@ -1594,7 +1602,7 @@
}, },
"showHeader": true "showHeader": true
}, },
"pluginVersion": "11.2.0", "pluginVersion": "11.1.4",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -1628,6 +1636,19 @@
"title": "Unused Indexes", "title": "Unused Indexes",
"type": "table" "type": "table"
}, },
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 48
},
"id": 23,
"panels": [],
"title": "Nostr",
"type": "row"
},
{ {
"datasource": { "datasource": {
"default": false, "default": false,
@ -1647,7 +1668,6 @@
"axisLabel": "", "axisLabel": "",
"axisPlacement": "auto", "axisPlacement": "auto",
"barAlignment": 0, "barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line", "drawStyle": "line",
"fillOpacity": 0, "fillOpacity": 0,
"gradientMode": "none", "gradientMode": "none",
@ -1758,7 +1778,7 @@
"h": 12, "h": 12,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 46 "y": 49
}, },
"id": 9, "id": 9,
"options": { "options": {
@ -1812,7 +1832,6 @@
"axisLabel": "", "axisLabel": "",
"axisPlacement": "auto", "axisPlacement": "auto",
"barAlignment": 0, "barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line", "drawStyle": "line",
"fillOpacity": 0, "fillOpacity": 0,
"gradientMode": "none", "gradientMode": "none",
@ -1896,7 +1915,7 @@
"h": 12, "h": 12,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 58 "y": 61
}, },
"id": 5, "id": 5,
"options": { "options": {
@ -1948,7 +1967,6 @@
"axisLabel": "", "axisLabel": "",
"axisPlacement": "auto", "axisPlacement": "auto",
"barAlignment": 0, "barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line", "drawStyle": "line",
"fillOpacity": 0, "fillOpacity": 0,
"gradientMode": "none", "gradientMode": "none",
@ -1995,7 +2013,7 @@
"h": 11, "h": 11,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 70 "y": 73
}, },
"id": 19, "id": 19,
"options": { "options": {
@ -2081,6 +2099,7 @@
"name": "prometheus", "name": "prometheus",
"options": [], "options": [],
"query": "prometheus", "query": "prometheus",
"queryValue": "",
"refresh": 1, "refresh": 1,
"regex": "", "regex": "",
"skipUrlSync": false, "skipUrlSync": false,
@ -2112,6 +2131,6 @@
"timezone": "browser", "timezone": "browser",
"title": "Ditto", "title": "Ditto",
"uid": "ddps3ap51fv28d", "uid": "ddps3ap51fv28d",
"version": 60, "version": 4,
"weekStart": "" "weekStart": ""
} }