Support selecting multi-value and all of variables job and host.

This commit is contained in:
Shizun Ge 2022-02-22 18:32:00 -08:00 committed by GitHub
parent 8be1fd752e
commit 3a741ec512
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,7 @@
"type": "grafana", "type": "grafana",
"id": "grafana", "id": "grafana",
"name": "Grafana", "name": "Grafana",
"version": "8.3.4" "version": "8.3.6"
}, },
{ {
"type": "panel", "type": "panel",
@ -73,13 +73,13 @@
} }
] ]
}, },
"description": "Dashboard for endlessh", "description": "Dashboard for endlessh (add option All to job and host)",
"editable": true, "editable": true,
"fiscalYearStartMonth": 0, "fiscalYearStartMonth": 0,
"gnetId": 15156, "gnetId": 15156,
"graphTooltip": 0, "graphTooltip": 0,
"id": null, "id": null,
"iteration": 1643266160767, "iteration": 1645482521172,
"links": [], "links": [],
"liveNow": false, "liveNow": false,
"panels": [ "panels": [
@ -128,7 +128,7 @@
"text": {}, "text": {},
"textMode": "auto" "textMode": "auto"
}, },
"pluginVersion": "8.3.4", "pluginVersion": "8.3.6",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -169,12 +169,6 @@
"id": "groupBy", "id": "groupBy",
"options": { "options": {
"fields": { "fields": {
"Value #Count": {
"aggregations": [
"lastNotNull"
],
"operation": "aggregate"
},
"Value #Seen": { "Value #Seen": {
"aggregations": [ "aggregations": [
"sum" "sum"
@ -203,13 +197,8 @@
"id": "organize", "id": "organize",
"options": { "options": {
"excludeByName": {}, "excludeByName": {},
"indexByName": { "indexByName": {},
"Field": 0,
"Total": 1
},
"renameByName": { "renameByName": {
"Total": "Total number connections that endlessh trapped",
"Value #Count (lastNotNull)": "Total number connections that endlessh trapped",
"Value #Seen (sum)": "Total number connections that endlessh trapped" "Value #Seen (sum)": "Total number connections that endlessh trapped"
} }
} }
@ -263,7 +252,7 @@
"text": {}, "text": {},
"textMode": "auto" "textMode": "auto"
}, },
"pluginVersion": "8.3.4", "pluginVersion": "8.3.6",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -304,22 +293,6 @@
"id": "groupBy", "id": "groupBy",
"options": { "options": {
"fields": { "fields": {
"Value #Count": {
"aggregations": [
"lastNotNull"
]
},
"Value #Seen": {
"aggregations": [
"sum"
]
},
"Value #Time": {
"aggregations": [
"lastNotNull"
],
"operation": "aggregate"
},
"Value #Trapped": { "Value #Trapped": {
"aggregations": [ "aggregations": [
"sum" "sum"
@ -351,8 +324,6 @@
"indexByName": {}, "indexByName": {},
"renameByName": { "renameByName": {
"Total": "Seconds spent on endlessh", "Total": "Seconds spent on endlessh",
"Value #Time (lastNotNull)": "Seconds spent on endlessh",
"Value #Trapped (lastNotNull)": "Time spent on endlessh",
"Value #Trapped (sum)": "Time spent on endlessh" "Value #Trapped (sum)": "Time spent on endlessh"
} }
} }
@ -406,11 +377,15 @@
"text": {}, "text": {},
"textMode": "auto" "textMode": "auto"
}, },
"pluginVersion": "8.3.4", "pluginVersion": "8.3.6",
"targets": [ "targets": [
{ {
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true, "exemplar": true,
"expr": "increase(endlessh_sent_bytes_total{instance=\"$host\",job=\"$job\"}[$__range])", "expr": "sum(increase(endlessh_sent_bytes_total{instance=~\"$host\",job=~\"$job\"}[$__range]))",
"hide": false, "hide": false,
"interval": "", "interval": "",
"legendFormat": "Bytes sent by endlessh", "legendFormat": "Bytes sent by endlessh",
@ -465,7 +440,7 @@
"text": {}, "text": {},
"textMode": "auto" "textMode": "auto"
}, },
"pluginVersion": "8.3.4", "pluginVersion": "8.3.6",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -488,14 +463,6 @@
"id": "groupBy", "id": "groupBy",
"options": { "options": {
"fields": { "fields": {
"Time": {
"aggregations": []
},
"Value #Count": {
"aggregations": [
"lastNotNull"
]
},
"Value #Seen": { "Value #Seen": {
"aggregations": [ "aggregations": [
"sum" "sum"
@ -526,7 +493,6 @@
"excludeByName": {}, "excludeByName": {},
"indexByName": {}, "indexByName": {},
"renameByName": { "renameByName": {
"Count": "Unique IPs connected",
"Value #Seen (sum)": "Unique IPs connected", "Value #Seen (sum)": "Unique IPs connected",
"ip": "" "ip": ""
} }
@ -587,7 +553,7 @@
"text": {}, "text": {},
"textMode": "value" "textMode": "value"
}, },
"pluginVersion": "8.3.4", "pluginVersion": "8.3.6",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -640,11 +606,6 @@
], ],
"operation": "aggregate" "operation": "aggregate"
}, },
"country": {
"aggregations": [
"lastNotNull"
]
},
"ip": { "ip": {
"aggregations": [], "aggregations": [],
"operation": "groupby" "operation": "groupby"
@ -670,17 +631,11 @@
"instance": true, "instance": true,
"job": true "job": true
}, },
"indexByName": { "indexByName": {},
"Time (lastNotNull)": 0,
"instance": 3,
"ip (lastNotNull)": 1,
"job": 2
},
"renameByName": { "renameByName": {
"Time (lastNotNull)": "Time", "Time (lastNotNull)": "Time",
"Value #Seen (sum)": "Count", "Value #Seen (sum)": "Count",
"ip": "Client IP of the latest connection", "ip": "Client IP of the latest connection"
"ip (lastNotNull)": "Client IP of the latest connection"
} }
} }
} }
@ -742,11 +697,15 @@
"text": {}, "text": {},
"textMode": "auto" "textMode": "auto"
}, },
"pluginVersion": "8.3.4", "pluginVersion": "8.3.6",
"targets": [ "targets": [
{ {
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true, "exemplar": true,
"expr": "(endlessh_client_open_count_total{instance=\"$host\",job=\"$job\"}) - (endlessh_client_closed_count_total{instance=\"$host\",job=\"$job\"} offset $__interval or endlessh_client_open_count_total{instance=\"$host\",job=\"$job\"} * 0)", "expr": "sum((endlessh_client_open_count_total{instance=~\"$host\",job=~\"$job\"}) - (endlessh_client_closed_count_total{instance=~\"$host\",job=~\"$job\"} offset $__interval or endlessh_client_open_count_total{instance=~\"$host\",job=~\"$job\"} * 0))",
"instant": false, "instant": false,
"interval": "", "interval": "",
"legendFormat": "Open Connections", "legendFormat": "Open Connections",
@ -924,12 +883,6 @@
"id": "groupBy", "id": "groupBy",
"options": { "options": {
"fields": { "fields": {
"Value #Count": {
"aggregations": [
"lastNotNull"
],
"operation": "aggregate"
},
"Value #Seen": { "Value #Seen": {
"aggregations": [ "aggregations": [
"sum" "sum"
@ -953,12 +906,6 @@
"id": "groupBy", "id": "groupBy",
"options": { "options": {
"fields": { "fields": {
"Value #Count (lastNotNull)": {
"aggregations": [
"sum"
],
"operation": "aggregate"
},
"Value #Seen (sum)": { "Value #Seen (sum)": {
"aggregations": [ "aggregations": [
"sum" "sum"
@ -968,10 +915,6 @@
"country (last)": { "country (last)": {
"aggregations": [], "aggregations": [],
"operation": "groupby" "operation": "groupby"
},
"country (lastNotNull)": {
"aggregations": [],
"operation": "groupby"
} }
} }
} }
@ -1076,7 +1019,7 @@
"zoom": 1 "zoom": 1
} }
}, },
"pluginVersion": "8.3.4", "pluginVersion": "8.3.6",
"targets": [ "targets": [
{ {
"datasource": { "datasource": {
@ -1117,50 +1060,18 @@
"id": "groupBy", "id": "groupBy",
"options": { "options": {
"fields": { "fields": {
"Time": {
"aggregations": [
"firstNotNull"
]
},
"Value": {
"aggregations": [
"lastNotNull"
],
"operation": "aggregate"
},
"Value #Count": {
"aggregations": [
"lastNotNull"
],
"operation": "aggregate"
},
"Value #Seen": { "Value #Seen": {
"aggregations": [ "aggregations": [
"sum" "sum"
], ],
"operation": "aggregate" "operation": "aggregate"
}, },
"Value #geo": {
"aggregations": [
"lastNotNull"
],
"operation": "aggregate"
},
"Value #time": {
"aggregations": [
"lastNotNull"
],
"operation": "aggregate"
},
"geohash": { "geohash": {
"aggregations": [ "aggregations": [
"lastNotNull" "lastNotNull"
], ],
"operation": "groupby" "operation": "groupby"
}, },
"ip": {
"aggregations": []
},
"location": { "location": {
"aggregations": [ "aggregations": [
"lastNotNull" "lastNotNull"
@ -1175,10 +1086,9 @@
"options": { "options": {
"excludeByName": {}, "excludeByName": {},
"indexByName": { "indexByName": {
"Time (firstNotNull) (firstNotNull)": 0, "Value #geo (lastNotNull) (sum)": 2,
"Value #geo (lastNotNull) (sum)": 3, "geohash (lastNotNull)": 0,
"geohash (lastNotNull)": 1, "location (lastNotNull) (lastNotNull)": 1
"location (lastNotNull) (lastNotNull)": 2
}, },
"renameByName": { "renameByName": {
"Value #Seen (sum)": "Connections", "Value #Seen (sum)": "Connections",
@ -1295,11 +1205,15 @@
} }
] ]
}, },
"pluginVersion": "8.3.4", "pluginVersion": "8.3.6",
"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",
"hide": false, "hide": false,
"interval": "", "interval": "",
@ -1307,8 +1221,12 @@
"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",
"hide": false, "hide": false,
"interval": "", "interval": "",
@ -1458,18 +1376,18 @@
"options": { "options": {
"excludeByName": {}, "excludeByName": {},
"indexByName": { "indexByName": {
"Time (max)": 0,
"ip": 1,
"country (lastNotNull)": 2,
"Seen (sum)": 3, "Seen (sum)": 3,
"Trapped (sum)": 4 "Time (max)": 0,
"Trapped (sum)": 4,
"country (lastNotNull)": 2,
"ip": 1
}, },
"renameByName": { "renameByName": {
"Time (max)": "Last Connection",
"ip": "IP",
"country (lastNotNull)": "Country",
"Seen (sum)": "Connections", "Seen (sum)": "Connections",
"Trapped (sum)": "Trapped Time" "Time (max)": "Last Connection",
"Trapped (sum)": "Trapped Time",
"country (lastNotNull)": "Country",
"ip": "IP"
} }
} }
} }
@ -1486,6 +1404,7 @@
"templating": { "templating": {
"list": [ "list": [
{ {
"allValue": ".*",
"current": {}, "current": {},
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
@ -1493,9 +1412,9 @@
}, },
"definition": "label_values(endlessh_client_open_count_total, job)", "definition": "label_values(endlessh_client_open_count_total, job)",
"hide": 0, "hide": 0,
"includeAll": false, "includeAll": true,
"label": "Job", "label": "Job",
"multi": false, "multi": true,
"name": "job", "name": "job",
"options": [], "options": [],
"query": { "query": {
@ -1509,20 +1428,21 @@
"type": "query" "type": "query"
}, },
{ {
"allValue": ".*",
"current": {}, "current": {},
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "${DS_PROMETHEUS}" "uid": "${DS_PROMETHEUS}"
}, },
"definition": "label_values(endlessh_client_open_count_total, instance)", "definition": "label_values(endlessh_client_open_count_total{job=~\"$job\"}, instance)",
"hide": 0, "hide": 0,
"includeAll": false, "includeAll": true,
"label": "Host", "label": "Host",
"multi": false, "multi": true,
"name": "host", "name": "host",
"options": [], "options": [],
"query": { "query": {
"query": "label_values(endlessh_client_open_count_total, instance)", "query": "label_values(endlessh_client_open_count_total{job=~\"$job\"}, instance)",
"refId": "StandardVariableQuery" "refId": "StandardVariableQuery"
}, },
"refresh": 1, "refresh": 1,
@ -1541,6 +1461,6 @@
"timezone": "", "timezone": "",
"title": "Endlessh", "title": "Endlessh",
"uid": "ATIxYkO7k", "uid": "ATIxYkO7k",
"version": 6, "version": 7,
"weekStart": "" "weekStart": ""
} }