Skip to content

Commit 80c0ee8

Browse files
authored
Dashboard improvements (#413)
Signed-off-by: BOUHOURS Antoine <[email protected]>
1 parent 65fd943 commit 80c0ee8

File tree

3 files changed

+135
-37
lines changed

3 files changed

+135
-37
lines changed

docker-compose/technical/grafana/dashboards/logs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
"showCommonLabels": false,
174174
"showLabels": false,
175175
"showTime": false,
176-
"sortOrder": "Descending",
176+
"sortOrder": "Ascending",
177177
"wrapLogMessage": true
178178
},
179179
"targets": [
@@ -183,7 +183,7 @@
183183
"uid": "${datasource}"
184184
},
185185
"editorMode": "code",
186-
"expr": "{pod=\"$pod\"} |~ \"$search\"",
186+
"expr": "{pod=\"$pod\"} |~ \"$search\" | pattern \"<r> stdout F <message>\" | line_format \"{{.message}}\"",
187187
"maxLines": 5000,
188188
"queryType": "range",
189189
"refId": "A"

docker-compose/technical/grafana/dashboards/pods_supervision.json

Lines changed: 128 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@
759759
"uid": "$datasource"
760760
},
761761
"editorMode": "code",
762-
"expr": "sum(container_memory_working_set_bytes{service=\"$service\", container=\"main\", image!=\"\"}) by (pod)",
762+
"expr": "sum(container_memory_working_set_bytes{container=\"main\", image!=\"\"}) by (pod)",
763763
"format": "table",
764764
"instant": true,
765765
"intervalFactor": 2,
@@ -785,7 +785,7 @@
785785
"uid": "$datasource"
786786
},
787787
"editorMode": "code",
788-
"expr": "sum(container_memory_working_set_bytes{service=\"$service\", container=\"main\", image!=\"\"}) by (pod) / sum(cluster:namespace:pod_memory:active:kube_pod_container_resource_limits) by (pod)",
788+
"expr": "sum(container_memory_working_set_bytes{container=\"main\", image!=\"\"}) by (pod) / sum(cluster:namespace:pod_memory:active:kube_pod_container_resource_limits) by (pod)",
789789
"format": "table",
790790
"instant": true,
791791
"intervalFactor": 2,
@@ -801,7 +801,7 @@
801801
"disableTextWrap": false,
802802
"editorMode": "code",
803803
"exemplar": false,
804-
"expr": "kube_pod_created{pod!~\".*cronjob.*\"} * 1000",
804+
"expr": "kube_pod_created * 1000",
805805
"format": "table",
806806
"fullMetaSearch": false,
807807
"hide": false,
@@ -883,6 +883,22 @@
883883
]
884884
}
885885
}
886+
},
887+
{
888+
"id": "filterByValue",
889+
"options": {
890+
"filters": [
891+
{
892+
"config": {
893+
"id": "isNull",
894+
"options": {}
895+
},
896+
"fieldName": "Value #CPU Usage"
897+
}
898+
],
899+
"match": "any",
900+
"type": "exclude"
901+
}
886902
}
887903
],
888904
"type": "table"
@@ -1117,6 +1133,13 @@
11171133
}
11181134
},
11191135
"fieldName": "last termination reason"
1136+
},
1137+
{
1138+
"config": {
1139+
"id": "isNotNull",
1140+
"options": {}
1141+
},
1142+
"fieldName": "last termination reason"
11201143
}
11211144
],
11221145
"match": "all",
@@ -1183,7 +1206,8 @@
11831206
"mode": "absolute",
11841207
"steps": [
11851208
{
1186-
"color": "green"
1209+
"color": "green",
1210+
"value": null
11871211
},
11881212
{
11891213
"color": "red",
@@ -1277,7 +1301,8 @@
12771301
"mode": "absolute",
12781302
"steps": [
12791303
{
1280-
"color": "green"
1304+
"color": "green",
1305+
"value": null
12811306
},
12821307
{
12831308
"color": "red",
@@ -1371,7 +1396,8 @@
13711396
"mode": "absolute",
13721397
"steps": [
13731398
{
1374-
"color": "green"
1399+
"color": "green",
1400+
"value": null
13751401
},
13761402
{
13771403
"color": "red",
@@ -1408,7 +1434,7 @@
14081434
"uid": "${datasource}"
14091435
},
14101436
"editorMode": "code",
1411-
"expr": "(kube_pod_container_status_restarts_total - kube_pod_container_status_restarts_total offset 10m >= 1) and ignoring (reason) min_over_time(kube_pod_container_status_last_terminated_reason{reason=\"OOMKilled\"}[10m]) == 1",
1437+
"expr": "(kube_pod_container_status_restarts_total - kube_pod_container_status_restarts_total offset 10m) and ignoring (reason) min_over_time(kube_pod_container_status_last_terminated_reason{reason=\"OOMKilled\"}[10m]) == 1",
14121438
"instant": false,
14131439
"legendFormat": "{{pod}}",
14141440
"range": true,
@@ -1417,6 +1443,101 @@
14171443
],
14181444
"title": "OOMKilled events",
14191445
"type": "timeseries"
1446+
},
1447+
{
1448+
"datasource": {
1449+
"type": "prometheus",
1450+
"uid": "$datasource"
1451+
},
1452+
"fieldConfig": {
1453+
"defaults": {
1454+
"color": {
1455+
"mode": "palette-classic"
1456+
},
1457+
"custom": {
1458+
"axisBorderShow": false,
1459+
"axisCenteredZero": false,
1460+
"axisColorMode": "text",
1461+
"axisLabel": "",
1462+
"axisPlacement": "auto",
1463+
"barAlignment": 0,
1464+
"drawStyle": "line",
1465+
"fillOpacity": 0,
1466+
"gradientMode": "none",
1467+
"hideFrom": {
1468+
"legend": false,
1469+
"tooltip": false,
1470+
"viz": false
1471+
},
1472+
"insertNulls": false,
1473+
"lineInterpolation": "linear",
1474+
"lineWidth": 1,
1475+
"pointSize": 5,
1476+
"scaleDistribution": {
1477+
"type": "linear"
1478+
},
1479+
"showPoints": "auto",
1480+
"spanNulls": false,
1481+
"stacking": {
1482+
"group": "A",
1483+
"mode": "none"
1484+
},
1485+
"thresholdsStyle": {
1486+
"mode": "off"
1487+
}
1488+
},
1489+
"mappings": [],
1490+
"thresholds": {
1491+
"mode": "absolute",
1492+
"steps": [
1493+
{
1494+
"color": "green",
1495+
"value": null
1496+
},
1497+
{
1498+
"color": "red",
1499+
"value": 80
1500+
}
1501+
]
1502+
}
1503+
},
1504+
"overrides": []
1505+
},
1506+
"gridPos": {
1507+
"h": 8,
1508+
"w": 12,
1509+
"x": 12,
1510+
"y": 33
1511+
},
1512+
"id": 53,
1513+
"options": {
1514+
"legend": {
1515+
"calcs": [],
1516+
"displayMode": "list",
1517+
"placement": "bottom",
1518+
"showLegend": true
1519+
},
1520+
"tooltip": {
1521+
"mode": "single",
1522+
"sort": "none"
1523+
}
1524+
},
1525+
"targets": [
1526+
{
1527+
"datasource": {
1528+
"type": "prometheus",
1529+
"uid": "${datasource}"
1530+
},
1531+
"editorMode": "code",
1532+
"expr": "(kube_pod_container_status_restarts_total - kube_pod_container_status_restarts_total offset 10m) and ignoring (reason) min_over_time(kube_pod_container_status_last_terminated_reason{reason=\"Error\"}[10m]) == 1",
1533+
"instant": false,
1534+
"legendFormat": "{{pod}}",
1535+
"range": true,
1536+
"refId": "A"
1537+
}
1538+
],
1539+
"title": "Error events",
1540+
"type": "timeseries"
14201541
}
14211542
],
14221543
"title": "Detailed infos",
@@ -1445,29 +1566,6 @@
14451566
"regex": "",
14461567
"skipUrlSync": false,
14471568
"type": "datasource"
1448-
},
1449-
{
1450-
"current": {},
1451-
"datasource": {
1452-
"type": "prometheus",
1453-
"uid": "${datasource}"
1454-
},
1455-
"definition": "label_values({service=\"kube-prometheus-stack-kubelet\"},service)",
1456-
"hide": 2,
1457-
"includeAll": false,
1458-
"multi": false,
1459-
"name": "service",
1460-
"options": [],
1461-
"query": {
1462-
"qryType": 1,
1463-
"query": "label_values({service=\"kube-prometheus-stack-kubelet\"},service)",
1464-
"refId": "PrometheusVariableQueryEditor-VariableQuery"
1465-
},
1466-
"refresh": 2,
1467-
"regex": "",
1468-
"skipUrlSync": false,
1469-
"sort": 1,
1470-
"type": "query"
14711569
}
14721570
]
14731571
},

docker-compose/technical/grafana/dashboards/users_metrics.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@
160160
},
161161
"editorMode": "code",
162162
"exemplar": true,
163-
"expr": "count(app_users)",
163+
"expr": "count(count by (user) (app_users)) OR on() vector(0)",
164164
"interval": "",
165-
"legendFormat": "",
165+
"legendFormat": "User count",
166166
"range": true,
167167
"refId": "A"
168168
}
@@ -256,14 +256,14 @@
256256
},
257257
"editorMode": "code",
258258
"exemplar": true,
259-
"expr": "sum(app_users)",
259+
"expr": "sum(app_users) OR on() vector(0)",
260260
"interval": "",
261-
"legendFormat": "",
261+
"legendFormat": "Connection count",
262262
"range": true,
263263
"refId": "A"
264264
}
265265
],
266-
"title": "Connexion count",
266+
"title": "Connection count",
267267
"type": "timeseries"
268268
},
269269
{

0 commit comments

Comments
 (0)