fix clients table

Fix the problem that some clients are missing from the table.
Also use filterByRefId instead merge to simplify transformations on some dashboards.
This commit is contained in:
Shizun Ge 2022-01-26 23:10:41 -08:00 committed by GitHub
parent 5bf122f623
commit ff985bb80e

View file

@ -73,13 +73,13 @@
} }
] ]
}, },
"description": "Dashboard for endlessh (Fix for Grafana 8.3.4)", "description": "Dashboard for endlessh",
"editable": true, "editable": true,
"fiscalYearStartMonth": 0, "fiscalYearStartMonth": 0,
"gnetId": 15156, "gnetId": 15156,
"graphTooltip": 0, "graphTooltip": 0,
"id": null, "id": null,
"iteration": 1642838440700, "iteration": 1643266160767,
"links": [], "links": [],
"liveNow": false, "liveNow": false,
"panels": [ "panels": [
@ -131,12 +131,22 @@
"pluginVersion": "8.3.4", "pluginVersion": "8.3.4",
"targets": [ "targets": [
{ {
"panelId": 47, "datasource": {
"type": "datasource",
"uid": "-- Dashboard --"
},
"panelId": 49,
"refId": "A" "refId": "A"
} }
], ],
"title": "Connections", "title": "Connections",
"transformations": [ "transformations": [
{
"id": "filterByRefId",
"options": {
"include": "Seen"
}
},
{ {
"id": "filterByValue", "id": "filterByValue",
"options": { "options": {
@ -189,10 +199,6 @@
] ]
} }
}, },
{
"id": "merge",
"options": {}
},
{ {
"id": "organize", "id": "organize",
"options": { "options": {
@ -260,12 +266,22 @@
"pluginVersion": "8.3.4", "pluginVersion": "8.3.4",
"targets": [ "targets": [
{ {
"panelId": 47, "datasource": {
"type": "datasource",
"uid": "-- Dashboard --"
},
"panelId": 49,
"refId": "A" "refId": "A"
} }
], ],
"title": "Trapped Time", "title": "Trapped Time",
"transformations": [ "transformations": [
{
"id": "filterByRefId",
"options": {
"include": "Trapped"
}
},
{ {
"id": "filterByValue", "id": "filterByValue",
"options": { "options": {
@ -280,7 +296,7 @@
"fieldName": "Value #Trapped" "fieldName": "Value #Trapped"
} }
], ],
"match": "any", "match": "all",
"type": "include" "type": "include"
} }
}, },
@ -328,10 +344,6 @@
] ]
} }
}, },
{
"id": "merge",
"options": {}
},
{ {
"id": "organize", "id": "organize",
"options": { "options": {
@ -456,12 +468,22 @@
"pluginVersion": "8.3.4", "pluginVersion": "8.3.4",
"targets": [ "targets": [
{ {
"panelId": 47, "datasource": {
"type": "datasource",
"uid": "-- Dashboard --"
},
"panelId": 49,
"refId": "A" "refId": "A"
} }
], ],
"title": "Unique IPs", "title": "Unique IPs",
"transformations": [ "transformations": [
{
"id": "filterByRefId",
"options": {
"include": "Seen"
}
},
{ {
"id": "groupBy", "id": "groupBy",
"options": { "options": {
@ -498,10 +520,6 @@
] ]
} }
}, },
{
"id": "merge",
"options": {}
},
{ {
"id": "organize", "id": "organize",
"options": { "options": {
@ -572,12 +590,22 @@
"pluginVersion": "8.3.4", "pluginVersion": "8.3.4",
"targets": [ "targets": [
{ {
"panelId": 47, "datasource": {
"type": "datasource",
"uid": "-- Dashboard --"
},
"panelId": 49,
"refId": "A" "refId": "A"
} }
], ],
"title": "Latest Connection", "title": "Latest Connection",
"transformations": [ "transformations": [
{
"id": "filterByRefId",
"options": {
"include": "Seen"
}
},
{ {
"id": "filterByValue", "id": "filterByValue",
"options": { "options": {
@ -624,28 +652,6 @@
} }
} }
}, },
{
"id": "merge",
"options": {}
},
{
"id": "filterByValue",
"options": {
"filters": [
{
"config": {
"id": "greater",
"options": {
"value": 0
}
},
"fieldName": "Value #Seen (sum)"
}
],
"match": "any",
"type": "include"
}
},
{ {
"id": "sortBy", "id": "sortBy",
"options": { "options": {
@ -880,12 +886,22 @@
}, },
"targets": [ "targets": [
{ {
"panelId": 47, "datasource": {
"type": "datasource",
"uid": "-- Dashboard --"
},
"panelId": 49,
"refId": "A" "refId": "A"
} }
], ],
"title": "Connections by country", "title": "Connections by country",
"transformations": [ "transformations": [
{
"id": "filterByRefId",
"options": {
"include": "Seen"
}
},
{ {
"id": "filterByValue", "id": "filterByValue",
"options": { "options": {
@ -933,10 +949,6 @@
} }
} }
}, },
{
"id": "merge",
"options": {}
},
{ {
"id": "groupBy", "id": "groupBy",
"options": { "options": {
@ -1067,12 +1079,22 @@
"pluginVersion": "8.3.4", "pluginVersion": "8.3.4",
"targets": [ "targets": [
{ {
"panelId": 47, "datasource": {
"type": "datasource",
"uid": "-- Dashboard --"
},
"panelId": 49,
"refId": "A" "refId": "A"
} }
], ],
"title": "Locations", "title": "Locations",
"transformations": [ "transformations": [
{
"id": "filterByRefId",
"options": {
"include": "Seen"
}
},
{ {
"id": "filterByValue", "id": "filterByValue",
"options": { "options": {
@ -1134,11 +1156,10 @@
"aggregations": [ "aggregations": [
"lastNotNull" "lastNotNull"
], ],
"operation": "aggregate" "operation": "groupby"
}, },
"ip": { "ip": {
"aggregations": [], "aggregations": []
"operation": "groupby"
}, },
"location": { "location": {
"aggregations": [ "aggregations": [
@ -1149,65 +1170,6 @@
} }
} }
}, },
{
"id": "groupBy",
"options": {
"fields": {
"Time (firstNotNull)": {
"aggregations": [
"firstNotNull"
],
"operation": "aggregate"
},
"Time (lastNotNull)": {
"aggregations": [
"lastNotNull"
],
"operation": "aggregate"
},
"Value #Count (lastNotNull)": {
"aggregations": [
"sum"
],
"operation": "aggregate"
},
"Value #Seen (sum)": {
"aggregations": [
"sum"
],
"operation": "aggregate"
},
"Value #geo (lastNotNull)": {
"aggregations": [
"sum"
],
"operation": "aggregate"
},
"Value #time (lastNotNull)": {
"aggregations": [
"sum"
],
"operation": "aggregate"
},
"Value (lastNotNull)": {
"aggregations": [
"sum"
],
"operation": "aggregate"
},
"geohash (lastNotNull)": {
"aggregations": [],
"operation": "groupby"
},
"location (lastNotNull)": {
"aggregations": [
"lastNotNull"
],
"operation": "aggregate"
}
}
}
},
{ {
"id": "organize", "id": "organize",
"options": { "options": {
@ -1219,17 +1181,9 @@
"location (lastNotNull) (lastNotNull)": 2 "location (lastNotNull) (lastNotNull)": 2
}, },
"renameByName": { "renameByName": {
"Time (firstNotNull) (firstNotNull)": "Time", "Value #Seen (sum)": "Connections",
"Time (firstNotNull) (lastNotNull)": "Time", "geohash": "Geohash",
"Value #Count (lastNotNull) (lastNotNull)": "Connections", "location (lastNotNull)": "Location"
"Value #Count (lastNotNull) (sum)": "Connections",
"Value #Seen (sum) (lastNotNull)": "Count",
"Value #Seen (sum) (sum)": "Connections",
"Value #geo (lastNotNull) (sum)": "Value",
"Value #time (lastNotNull) (sum)": "Trapped Time",
"Value (lastNotNull) (sum)": "Value",
"geohash (lastNotNull)": "Geohash",
"location (lastNotNull) (lastNotNull)": "Location"
} }
} }
} }
@ -1237,10 +1191,6 @@
"type": "geomap" "type": "geomap"
}, },
{ {
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"color": { "color": {
@ -1274,6 +1224,14 @@
{ {
"id": "custom.minWidth", "id": "custom.minWidth",
"value": 150 "value": 150
},
{
"id": "unit",
"value": "dateTimeAsIso"
},
{
"id": "custom.align",
"value": "left"
} }
] ]
}, },
@ -1315,7 +1273,7 @@
"x": 12, "x": 12,
"y": 11 "y": 11
}, },
"id": 47, "id": 49,
"options": { "options": {
"footer": { "footer": {
"fields": "", "fields": "",
@ -1336,6 +1294,10 @@
"pluginVersion": "8.3.4", "pluginVersion": "8.3.4",
"targets": [ "targets": [
{ {
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true, "exemplar": true,
"expr": "(endlessh_client_open_count{instance=\"$host\",job=\"$job\"} - endlessh_client_open_count{instance=\"$host\",job=\"$job\"} offset $__interval) > 0 or (endlessh_client_open_count{instance=\"$host\",job=\"$job\"}!=0 unless endlessh_client_open_count{instance=\"$host\",job=\"$job\"} offset $__interval)", "expr": "(endlessh_client_open_count{instance=\"$host\",job=\"$job\"} - endlessh_client_open_count{instance=\"$host\",job=\"$job\"} offset $__interval) > 0 or (endlessh_client_open_count{instance=\"$host\",job=\"$job\"}!=0 unless endlessh_client_open_count{instance=\"$host\",job=\"$job\"} offset $__interval)",
"format": "table", "format": "table",
@ -1345,6 +1307,10 @@
"refId": "Seen" "refId": "Seen"
}, },
{ {
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true, "exemplar": true,
"expr": "(endlessh_client_trapped_time_seconds{instance=\"$host\",job=\"$job\"} - endlessh_client_trapped_time_seconds{instance=\"$host\",job=\"$job\"} offset $__interval) > 0 or (endlessh_client_trapped_time_seconds{instance=\"$host\",job=\"$job\"}!=0 unless endlessh_client_trapped_time_seconds{instance=\"$host\",job=\"$job\"} offset $__interval)", "expr": "(endlessh_client_trapped_time_seconds{instance=\"$host\",job=\"$job\"} - endlessh_client_trapped_time_seconds{instance=\"$host\",job=\"$job\"} offset $__interval) > 0 or (endlessh_client_trapped_time_seconds{instance=\"$host\",job=\"$job\"}!=0 unless endlessh_client_trapped_time_seconds{instance=\"$host\",job=\"$job\"} offset $__interval)",
"format": "table", "format": "table",
@ -1356,10 +1322,6 @@
], ],
"title": "Clients", "title": "Clients",
"transformations": [ "transformations": [
{
"id": "merge",
"options": {}
},
{ {
"id": "filterByValue", "id": "filterByValue",
"options": { "options": {
@ -1383,6 +1345,63 @@
"fieldName": "Value #Trapped" "fieldName": "Value #Trapped"
} }
], ],
"match": "any",
"type": "include"
}
},
{
"id": "merge",
"options": {}
},
{
"id": "calculateField",
"options": {
"alias": "Seen",
"mode": "reduceRow",
"reduce": {
"include": [
"Value #Seen"
],
"reducer": "sum"
}
}
},
{
"id": "calculateField",
"options": {
"alias": "Trapped",
"mode": "reduceRow",
"reduce": {
"include": [
"Value #Trapped"
],
"reducer": "sum"
}
}
},
{
"id": "filterByValue",
"options": {
"filters": [
{
"config": {
"id": "greaterOrEqual",
"options": {
"value": 0
}
},
"fieldName": "Seen"
},
{
"config": {
"id": "greaterOrEqual",
"options": {
"value": 0
}
},
"fieldName": "Trapped"
}
],
"match": "all", "match": "all",
"type": "include" "type": "include"
} }
@ -1391,19 +1410,19 @@
"id": "groupBy", "id": "groupBy",
"options": { "options": {
"fields": { "fields": {
"Time": { "Seen": {
"aggregations": [
"lastNotNull"
],
"operation": "aggregate"
},
"Value #Seen": {
"aggregations": [ "aggregations": [
"sum" "sum"
], ],
"operation": "aggregate" "operation": "aggregate"
}, },
"Value #Trapped": { "Time": {
"aggregations": [
"max"
],
"operation": "aggregate"
},
"Trapped": {
"aggregations": [ "aggregations": [
"sum" "sum"
], ],
@ -1423,44 +1442,19 @@
} }
}, },
{ {
"id": "groupBy", "id": "filterByValue",
"options": { "options": {
"fields": { "filters": [
"Time (lastNotNull)": { {
"aggregations": [ "config": {
"firstNotNull" "id": "isNull",
], "options": {}
"operation": "aggregate" },
}, "fieldName": "ip"
"Value #Seen (sum)": {
"aggregations": [
"lastNotNull"
],
"operation": "aggregate"
},
"Value #Trapped (lastNotNull)": {
"aggregations": [
"lastNotNull"
],
"operation": "aggregate"
},
"Value #Trapped (sum)": {
"aggregations": [
"lastNotNull"
],
"operation": "aggregate"
},
"country (lastNotNull)": {
"aggregations": [
"lastNotNull"
],
"operation": "aggregate"
},
"ip": {
"aggregations": [],
"operation": "groupby"
} }
} ],
"match": "any",
"type": "exclude"
} }
}, },
{ {
@ -1468,19 +1462,18 @@
"options": { "options": {
"excludeByName": {}, "excludeByName": {},
"indexByName": { "indexByName": {
"Time (lastNotNull) (firstNotNull)": 0, "Time (max)": 0,
"Value #Seen (sum) (lastNotNull)": 3, "ip": 1,
"Value #Trapped (lastNotNull) (lastNotNull)": 4, "country (lastNotNull)": 2,
"country (lastNotNull) (lastNotNull)": 2, "Seen (sum)": 3,
"ip": 1 "Trapped (sum)": 4
}, },
"renameByName": { "renameByName": {
"Time (lastNotNull) (firstNotNull)": "Last Connection", "Time (max)": "Last Connection",
"Value #Seen (sum) (lastNotNull)": "Connections", "ip": "IP",
"Value #Trapped (lastNotNull) (lastNotNull)": "Trapped Time", "country (lastNotNull)": "Country",
"Value #Trapped (sum) (lastNotNull)": "Trapped Time", "Seen (sum)": "Connections",
"country (lastNotNull) (lastNotNull)": "Country", "Trapped (sum)": "Trapped Time"
"ip": "IP"
} }
} }
} }
@ -1552,6 +1545,6 @@
"timezone": "", "timezone": "",
"title": "Endlessh", "title": "Endlessh",
"uid": "ATIxYkO7k", "uid": "ATIxYkO7k",
"version": 4, "version": 5,
"weekStart": "" "weekStart": ""
} }