{ "__inputs": [ { "name": "DS_PROMETHEUS", "label": "Prometheus", "description": "", "type": "datasource", "pluginId": "prometheus", "pluginName": "Prometheus" } ], "__elements": {}, "__requires": [ { "type": "panel", "id": "geomap", "name": "Geomap", "version": "" }, { "type": "grafana", "id": "grafana", "name": "Grafana", "version": "12.3.0-18356121373.patch9" }, { "type": "panel", "id": "piechart", "name": "Pie chart", "version": "" }, { "type": "datasource", "id": "prometheus", "name": "Prometheus", "version": "1.0.0" }, { "type": "panel", "id": "stat", "name": "Stat", "version": "" }, { "type": "panel", "id": "table", "name": "Table", "version": "" }, { "type": "panel", "id": "timeseries", "name": "Time series", "version": "" } ], "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "datasource", "uid": "grafana" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "target": { "limit": 100, "matchAny": false, "tags": [], "type": "dashboard" }, "type": "dashboard" } ] }, "description": "Dashboard for endlessh (Add ports selection)", "editable": false, "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": null, "links": [ { "asDropdown": false, "icon": "external link", "includeVars": false, "keepTime": false, "tags": [], "targetBlank": true, "title": "GitHub", "tooltip": "GitHub", "type": "link", "url": "https://github.com/shizunge/endlessh-go" }, { "asDropdown": false, "icon": "external link", "includeVars": false, "keepTime": false, "tags": [], "targetBlank": true, "title": "Grafana", "tooltip": "Grafana Dashboard", "type": "link", "url": "https://grafana.com/grafana/dashboards/15156" } ], "panels": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] } }, "overrides": [] }, "gridPos": { "h": 3, "w": 4, "x": 0, "y": 0 }, "id": 36, "interval": "1m", "maxDataPoints": 1440, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "/^Total number connections that endlessh trapped$/", "values": false }, "showPercentChange": false, "text": {}, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.0-18356121373.patch9", "targets": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "expr": "(endlessh_client_open_count{instance=~\"$host\", local_port=~\"$port\",job=~\"$job\"} - endlessh_client_open_count{instance=~\"$host\",local_port=~\"$port\",job=~\"$job\"} offset $__interval) > 0 or (endlessh_client_open_count{instance=~\"$host\",local_port=~\"$port\",job=~\"$job\"}!=0 unless endlessh_client_open_count{instance=~\"$host\",local_port=~\"$port\",job=~\"$job\"} offset $__interval)", "format": "table", "instant": false, "legendFormat": "Seen {{ip}}", "range": true, "refId": "Seen" }, { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "expr": "(endlessh_client_trapped_time_seconds{instance=~\"$host\",local_port=~\"$port\",job=~\"$job\"} - endlessh_client_trapped_time_seconds{instance=~\"$host\",local_port=~\"$port\",job=~\"$job\"} offset $__interval) > 0 or (endlessh_client_trapped_time_seconds{instance=~\"$host\",local_port=~\"$port\",job=~\"$job\"}!=0 unless endlessh_client_trapped_time_seconds{instance=~\"$host\",local_port=~\"$port\",job=~\"$job\"} offset $__interval)", "format": "table", "hide": false, "instant": false, "legendFormat": "Trapped {{ip}}", "range": true, "refId": "Trapped" } ], "title": "Connections", "transformations": [ { "id": "filterByRefId", "options": { "include": "Seen" } }, { "id": "filterByValue", "options": { "filters": [ { "config": { "id": "greaterOrEqual", "options": { "value": 0 } }, "fieldName": "Value #Seen" } ], "match": "any", "type": "include" } }, { "id": "groupBy", "options": { "fields": { "Value #Seen": { "aggregations": [ "sum" ], "operation": "aggregate" }, "ip": { "aggregations": [], "operation": "groupby" } } } }, { "id": "reduce", "options": { "includeTimeField": false, "labelsToFields": false, "mode": "reduceFields", "reducers": [ "sum" ] } }, { "id": "organize", "options": { "excludeByName": {}, "indexByName": {}, "renameByName": { "Value #Seen (sum)": "Total number connections that endlessh trapped" } } } ], "type": "stat" }, { "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] }, "unit": "s" }, "overrides": [] }, "gridPos": { "h": 3, "w": 4, "x": 4, "y": 0 }, "id": 42, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "/^Time spent on endlessh$/", "values": false }, "showPercentChange": false, "text": {}, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.0-18356121373.patch9", "targets": [ { "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "panelId": 36, "refId": "A" } ], "title": "Trapped Time", "transformations": [ { "id": "filterByRefId", "options": { "include": "Trapped" } }, { "id": "filterByValue", "options": { "filters": [ { "config": { "id": "greaterOrEqual", "options": { "value": 0 } }, "fieldName": "Value #Trapped" } ], "match": "all", "type": "include" } }, { "id": "groupBy", "options": { "fields": { "Value #Trapped": { "aggregations": [ "sum" ], "operation": "aggregate" }, "ip": { "aggregations": [], "operation": "groupby" } } } }, { "id": "reduce", "options": { "includeTimeField": false, "labelsToFields": false, "mode": "reduceFields", "reducers": [ "sum" ] } }, { "id": "organize", "options": { "excludeByName": {}, "indexByName": {}, "renameByName": { "Total": "Seconds spent on endlessh", "Value #Trapped (sum)": "Time spent on endlessh" } } } ], "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 3, "w": 4, "x": 8, "y": 0 }, "id": 18, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "text": {}, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.0-18356121373.patch9", "targets": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "exemplar": true, "expr": "sum(increase(endlessh_sent_bytes_total{instance=~\"$host\",local_port=~\"$port\",job=~\"$job\"}[$__range]))", "hide": false, "interval": "", "legendFormat": "Bytes sent by endlessh", "range": true, "refId": "sent_bytes" } ], "title": "Sent Bytes", "type": "stat" }, { "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] } }, "overrides": [] }, "gridPos": { "h": 3, "w": 4, "x": 12, "y": 0 }, "id": 38, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "/^Unique IPs connected$/", "values": false }, "showPercentChange": false, "text": {}, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.0-18356121373.patch9", "targets": [ { "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "panelId": 36, "refId": "A" } ], "title": "Unique IPs", "transformations": [ { "id": "filterByRefId", "options": { "include": "Seen" } }, { "id": "groupBy", "options": { "fields": { "Value #Seen": { "aggregations": [ "sum" ], "operation": "aggregate" }, "ip": { "aggregations": [], "operation": "groupby" } } } }, { "id": "reduce", "options": { "includeTimeField": false, "labelsToFields": false, "mode": "reduceFields", "reducers": [ "count" ] } }, { "id": "organize", "options": { "excludeByName": {}, "indexByName": {}, "renameByName": { "Value #Seen (sum)": "Unique IPs connected", "ip": "" } } } ], "type": "stat" }, { "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "links": [ { "targetBlank": true, "title": "whois", "url": "https://search.arin.net/rdap/?query=${__value.text}" } ], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] } }, "overrides": [] }, "gridPos": { "h": 3, "w": 4, "x": 16, "y": 0 }, "id": 45, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "/^Client IP of the latest connection$/", "values": false }, "showPercentChange": false, "text": {}, "textMode": "value", "wideLayout": true }, "pluginVersion": "12.3.0-18356121373.patch9", "targets": [ { "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "panelId": 36, "refId": "A" } ], "title": "Latest Connection", "transformations": [ { "id": "filterByRefId", "options": { "include": "Seen" } }, { "id": "filterByValue", "options": { "filters": [ { "config": { "id": "greaterOrEqual", "options": { "value": 0 } }, "fieldName": "Value #Seen" } ], "match": "any", "type": "include" } }, { "id": "groupBy", "options": { "fields": { "Time": { "aggregations": [ "lastNotNull" ], "operation": "aggregate" }, "Value #Seen": { "aggregations": [ "sum" ], "operation": "aggregate" }, "ip": { "aggregations": [], "operation": "groupby" } } } }, { "id": "sortBy", "options": { "fields": {}, "sort": [ { "field": "Time (lastNotNull)" } ] } }, { "id": "organize", "options": { "excludeByName": { "instance": true, "job": true }, "indexByName": {}, "renameByName": { "Time (lastNotNull)": "Time", "Value #Seen (sum)": "Count", "ip": "Client IP of the latest connection" } } } ], "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "#EAB839", "value": 10 }, { "color": "red", "value": 20 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 3, "w": 4, "x": 20, "y": 0 }, "id": 20, "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "text": {}, "textMode": "auto", "wideLayout": true }, "pluginVersion": "12.3.0-18356121373.patch9", "targets": [ { "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "exemplar": true, "expr": "sum((endlessh_client_open_count_total{instance=~\"$host\",local_port=~\"$port\",job=~\"$job\"}) - (endlessh_client_closed_count_total{instance=~\"$host\",local_port=~\"$port\",job=~\"$job\"} or endlessh_client_open_count_total{instance=~\"$host\",local_port=~\"$port\",job=~\"$job\"} * 0))", "instant": false, "interval": "", "legendFormat": "Open Connections", "refId": "current_open" } ], "title": "Current Connections", "type": "stat" }, { "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "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": "stepAfter", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] } }, "overrides": [] }, "gridPos": { "h": 4, "w": 12, "x": 0, "y": 3 }, "id": 30, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "pluginVersion": "12.3.0-18356121373.patch9", "targets": [ { "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "panelId": 20, "refId": "A" } ], "title": "Concurrent Connections", "type": "timeseries" }, { "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "hideFrom": { "legend": false, "tooltip": false, "viz": false } }, "mappings": [] }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 3 }, "id": 32, "options": { "displayLabels": [], "legend": { "displayMode": "table", "placement": "right", "showLegend": true, "values": [ "value", "percent" ] }, "pieType": "pie", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "sort": "desc", "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "pluginVersion": "12.3.0-18356121373.patch9", "targets": [ { "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "panelId": 36, "refId": "A" } ], "title": "Connections by Country", "transformations": [ { "id": "filterByRefId", "options": { "include": "Seen" } }, { "id": "filterByValue", "options": { "filters": [ { "config": { "id": "greaterOrEqual", "options": { "value": 0 } }, "fieldName": "Value #Seen" } ], "match": "any", "type": "include" } }, { "id": "groupBy", "options": { "fields": { "Value #Seen": { "aggregations": [ "sum" ], "operation": "aggregate" }, "country": { "aggregations": [ "last" ], "operation": "aggregate" }, "ip": { "aggregations": [], "operation": "groupby" } } } }, { "id": "groupBy", "options": { "fields": { "Value #Seen (sum)": { "aggregations": [ "sum" ], "operation": "aggregate" }, "country (last)": { "aggregations": [], "operation": "groupby" } } } }, { "id": "rowsToFields", "options": {} } ], "type": "piechart" }, { "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "fieldConfig": { "defaults": { "color": { "mode": "continuous-GrYlRd" }, "custom": { "hideFrom": { "legend": false, "tooltip": false, "viz": false } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "#96D98D", "value": 0 } ] } }, "overrides": [] }, "gridPos": { "h": 12, "w": 12, "x": 0, "y": 7 }, "id": 48, "options": { "basemap": { "config": {}, "name": "Layer 0", "type": "default" }, "controls": { "mouseWheelZoom": false, "showAttribution": false, "showDebug": false, "showMeasure": false, "showScale": false, "showZoom": true }, "layers": [ { "config": { "color": { "field": "Connections", "fixed": "dark-green" }, "fillOpacity": 0.4, "shape": "circle", "showLegend": false, "size": { "field": "Connections", "fixed": 5, "max": 10, "min": 2 }, "style": { "color": { "field": "Connections", "fixed": "dark-green" }, "size": { "field": "Connections", "fixed": 5, "max": 9, "min": 2 }, "text": { "field": "location (lastNotNull) (lastNotNull)", "fixed": "", "mode": "fixed" } } }, "location": { "geohash": "Geohash", "mode": "geohash" }, "name": "Layer 1", "type": "markers" } ], "tooltip": { "mode": "details" }, "view": { "allLayers": true, "id": "zero", "lat": 0, "lon": 0, "noRepeat": false, "zoom": 1 } }, "pluginVersion": "12.3.0-18356121373.patch9", "targets": [ { "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "panelId": 36, "refId": "A" } ], "title": "Locations", "transformations": [ { "id": "filterByRefId", "options": { "include": "Seen" } }, { "id": "filterByValue", "options": { "filters": [ { "config": { "id": "greaterOrEqual", "options": { "value": 0 } }, "fieldName": "Value #Seen" } ], "match": "any", "type": "include" } }, { "id": "groupBy", "options": { "fields": { "Value #Seen": { "aggregations": [ "sum" ], "operation": "aggregate" }, "geohash": { "aggregations": [ "lastNotNull" ], "operation": "groupby" }, "location": { "aggregations": [ "lastNotNull" ], "operation": "aggregate" } } } }, { "id": "organize", "options": { "excludeByName": {}, "indexByName": { "Value #geo (lastNotNull) (sum)": 2, "geohash (lastNotNull)": 0, "location (lastNotNull) (lastNotNull)": 1 }, "renameByName": { "Value #Seen (sum)": "Connections", "geohash": "Geohash", "location (lastNotNull)": "Location" } } } ], "type": "geomap" }, { "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "filterable": true, "footer": { "reducers": [] }, "inspect": false, "minWidth": 50 }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Last Connection" }, "properties": [ { "id": "custom.minWidth", "value": 150 }, { "id": "unit", "value": "dateTimeAsIso" }, { "id": "custom.align", "value": "left" } ] }, { "matcher": { "id": "byName", "options": "IP" }, "properties": [ { "id": "links", "value": [ { "targetBlank": true, "title": "search ARIN", "url": "https://search.arin.net/rdap/?query=${__data.fields.IP}" } ] } ] }, { "matcher": { "id": "byName", "options": "Trapped Time" }, "properties": [ { "id": "unit", "value": "s" } ] } ] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 11 }, "id": 49, "options": { "cellHeight": "sm", "frameIndex": 0, "showHeader": true, "sortBy": [ { "desc": true, "displayName": "Last Connection" } ] }, "pluginVersion": "12.3.0-18356121373.patch9", "targets": [ { "datasource": { "type": "datasource", "uid": "-- Dashboard --" }, "panelId": 36, "refId": "A" } ], "title": "Clients", "transformations": [ { "id": "filterByValue", "options": { "filters": [ { "config": { "id": "greaterOrEqual", "options": { "value": 0 } }, "fieldName": "Value #Seen" }, { "config": { "id": "greaterOrEqual", "options": { "value": 0 } }, "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", "type": "include" } }, { "id": "groupBy", "options": { "fields": { "Seen": { "aggregations": [ "sum" ], "operation": "aggregate" }, "Time": { "aggregations": [ "max" ], "operation": "aggregate" }, "Trapped": { "aggregations": [ "sum" ], "operation": "aggregate" }, "country": { "aggregations": [ "lastNotNull" ], "operation": "aggregate" }, "ip": { "aggregations": [], "operation": "groupby" } } } }, { "id": "filterByValue", "options": { "filters": [ { "config": { "id": "isNull", "options": {} }, "fieldName": "ip" } ], "match": "any", "type": "exclude" } }, { "id": "organize", "options": { "excludeByName": {}, "indexByName": { "Seen (sum)": 3, "Time (max)": 0, "Trapped (sum)": 4, "country (lastNotNull)": 2, "ip": 1 }, "renameByName": { "Seen (sum)": "Connections", "Time (max)": "Last Connection", "Trapped (sum)": "Trapped Time", "country (lastNotNull)": "Country", "ip": "IP" } } } ], "type": "table" } ], "refresh": "", "schemaVersion": 42, "tags": [ "prometheus" ], "templating": { "list": [ { "allValue": ".*", "current": {}, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "definition": "label_values(endlessh_client_open_count_total, job)", "includeAll": true, "label": "Job", "multi": true, "name": "job", "options": [], "query": { "query": "label_values(endlessh_client_open_count_total, job)", "refId": "StandardVariableQuery" }, "refresh": 2, "regex": "", "sort": 1, "type": "query" }, { "allValue": ".*", "current": {}, "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, "definition": "label_values(endlessh_client_open_count_total{job=~\"$job\"}, instance)", "includeAll": true, "label": "Host", "multi": true, "name": "host", "options": [], "query": { "query": "label_values(endlessh_client_open_count_total{job=~\"$job\"}, instance)", "refId": "StandardVariableQuery" }, "refresh": 2, "regex": "", "sort": 1, "type": "query" }, { "allValue": ".*", "current": {}, "definition": "label_values(endlessh_client_open_count_total{job=~\"$job\", instance=~\"$host\"},local_port)", "description": "", "includeAll": true, "label": "Port", "multi": true, "name": "port", "options": [], "query": { "qryType": 1, "query": "label_values(endlessh_client_open_count_total{job=~\"$job\", instance=~\"$host\"},local_port)", "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 2, "regex": "", "sort": 1, "type": "query" } ] }, "time": { "from": "now-24h", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Endlessh", "uid": "ATIxYkO7k", "version": 13, "weekStart": "" }