From 1010e0d5352e8e68b65ee290f08b187190365737 Mon Sep 17 00:00:00 2001 From: Chris Marslender Date: Wed, 13 Mar 2024 21:28:22 -0500 Subject: [PATCH] Add peers by ASN + update to non-deprecated map panel (#82) --- dashboards/blockchain/peer-info.json | 569 +++++++++++++++++++++------ 1 file changed, 449 insertions(+), 120 deletions(-) diff --git a/dashboards/blockchain/peer-info.json b/dashboards/blockchain/peer-info.json index 90a0f94..3c7731a 100644 --- a/dashboards/blockchain/peer-info.json +++ b/dashboards/blockchain/peer-info.json @@ -3,7 +3,10 @@ "list": [ { "builtIn": 1, - "datasource": "-- Grafana --", + "datasource": { + "type": "datasource", + "uid": "grafana" + }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", @@ -21,12 +24,15 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 2, - "iteration": 1659119937840, + "id": 4, "links": [], "liveNow": false, "panels": [ { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, "description": "This is the total number of nodes gossiped in the last 5 days. Does not mean we were able to connect to them.", "fieldConfig": { "defaults": { @@ -65,10 +71,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "8.3.3", + "pluginVersion": "10.4.0", "targets": [ { "datasource": { @@ -87,46 +95,127 @@ "type": "stat" }, { - "circleMaxSize": 30, - "circleMinSize": 2, - "colors": [ - "#F2495C", - "rgba(237, 129, 40, 0.89)" - ], - "decimals": 0, + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, "description": "Peer distribution within a country/region is not reflected", - "esMetric": "Count", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, "gridPos": { "h": 12, "w": 9, "x": 3, "y": 0 }, - "hideEmpty": false, - "hideZero": false, "id": 24, - "initialZoom": 1, - "locationData": "countries", - "mapCenter": "(0°, 0°)", - "mapCenterLatitude": 0, - "mapCenterLongitude": 0, "maxDataPoints": 1, - "mouseWheelZoom": false, - "showLegend": false, - "stickyLabels": false, - "tableQueryOptions": { - "geohashField": "geohash", - "latitudeField": "latitude", - "longitudeField": "longitude", - "metricField": "metric", - "queryType": "geohash" + "options": { + "basemap": { + "name": "Basemap", + "type": "default" + }, + "controls": { + "mouseWheelZoom": false, + "showAttribution": true, + "showDebug": false, + "showMeasure": false, + "showScale": false, + "showZoom": true + }, + "layers": [ + { + "config": { + "showLegend": true, + "style": { + "color": { + "fixed": "dark-green" + }, + "opacity": 0.4, + "rotation": { + "fixed": 0, + "max": 360, + "min": -360, + "mode": "mod" + }, + "size": { + "field": "Total", + "fixed": 5, + "max": 20, + "min": 2 + }, + "symbol": { + "fixed": "img/icons/marker/circle.svg", + "mode": "fixed" + }, + "symbolAlign": { + "horizontal": "center", + "vertical": "center" + }, + "textConfig": { + "fontSize": 12, + "offsetX": 0, + "offsetY": 0, + "textAlign": "center", + "textBaseline": "middle" + } + } + }, + "location": { + "gazetteer": "public/gazetteer/countries.json", + "mode": "lookup" + }, + "name": "Layer 0", + "tooltip": true, + "type": "markers" + } + ], + "tooltip": { + "mode": "details" + }, + "view": { + "allLayers": true, + "id": "zero", + "lat": 0, + "lon": 0, + "zoom": 1 + } }, + "pluginVersion": "10.4.0", "targets": [ { "datasource": { "type": "prometheus", "uid": "PB06BBC9CA81C548D" }, + "editorMode": "code", "exemplar": false, "expr": "max by (country) (chia_crawler_country_node_count{network=\"$network\"})", "instant": true, @@ -135,14 +224,24 @@ "refId": "A" } ], - "thresholds": "", "title": "Peer Map (By Country/Region)", - "type": "grafana-worldmap-panel", - "unitPlural": "", - "unitSingle": "", - "valueName": "total" + "transformations": [ + { + "id": "reduce", + "options": { + "reducers": [ + "sum" + ] + } + } + ], + "type": "geomap" }, { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, "description": "", "fieldConfig": { "defaults": { @@ -151,7 +250,10 @@ }, "custom": { "align": "auto", - "displayMode": "auto" + "cellOptions": { + "type": "auto" + }, + "inspect": false }, "mappings": [], "thresholds": { @@ -175,7 +277,9 @@ }, "id": 28, "options": { + "cellHeight": "sm", "footer": { + "countRows": false, "fields": "", "reducer": [ "sum" @@ -186,11 +290,11 @@ "sortBy": [ { "desc": true, - "displayName": "Gossiped Peer Count" + "displayName": "Value" } ] }, - "pluginVersion": "8.3.3", + "pluginVersion": "10.4.0", "targets": [ { "datasource": { @@ -238,26 +342,58 @@ }, { "datasource": { - "uid": "PB06BBC9CA81C548D", - "type": "prometheus" + "type": "mysql", + "uid": "P00A25F4DA48796D5" }, - "description": "Shows the fraction of peers discovered that run a version recent enough to support the 2.1 hard fork", "fieldConfig": { "defaults": { - "custom": { - "hideFrom": { - "tooltip": false, - "viz": false, - "legend": false - } - }, - "unitScale": true, "color": { - "mode": "palette-classic" + "mode": "thresholds" }, - "mappings": [] + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "asn" + }, + "properties": [ + { + "id": "custom.width", + "value": 72 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "count" + }, + "properties": [ + { + "id": "custom.width", + "value": 72 + } + ] + } + ] }, "gridPos": { "h": 12, @@ -265,64 +401,65 @@ "x": 17, "y": 0 }, - "id": 30, + "id": 31, "options": { - "reduceOptions": { - "values": false, - "calcs": [ - "lastNotNull" + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" ], - "fields": "" - }, - "pieType": "pie", - "tooltip": { - "mode": "single", - "sort": "none" - }, - "legend": { - "showLegend": true, - "displayMode": "list", - "placement": "bottom", - "values": [ - "percent" - ] + "show": false }, - "displayLabels": [ - "percent" + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "count" + } ] }, + "pluginVersion": "10.4.0", "targets": [ { + "dataset": "blocks", "datasource": { - "type": "prometheus", - "uid": "PB06BBC9CA81C548D" - }, - "exemplar": false, - "expr": "sum(max by (version) (chia_crawler_peer_version{network=\"$network\", version =~ \"[2-9]\\\\.[1-9][0-9]*\\\\.[0-9]+.*\"}))", - "interval": "", - "legendFormat": "ready for hard fork", - "refId": "A", - "editorMode": "code", - "range": true - }, - { - "datasource": { - "uid": "PB06BBC9CA81C548D", - "type": "prometheus" + "type": "mysql", + "uid": "P00A25F4DA48796D5" }, - "refId": "B", - "expr": "sum(max by (version) (chia_crawler_peer_version{network=\"$network\", version !~ \"[2-9]\\\\.[1-9][0-9]*\\\\.[0-9]+.*\"}))", - "range": true, - "instant": false, - "hide": false, "editorMode": "code", - "legendFormat": "not ready" + "format": "table", + "rawQuery": true, + "rawSql": "SELECT asn, organization, count FROM `chia-exporter`.asn WHERE network = '$network' ORDER BY count DESC LIMIT 10000", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } } ], - "title": "Hard fork readiness", - "type": "piechart" + "title": "Peers by ASN", + "type": "table" }, { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, "description": "Nodes with available connections are nodes that allow inbound connections and have available space for more peers to connect", "fieldConfig": { "defaults": { @@ -361,10 +498,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "8.3.3", + "pluginVersion": "10.4.0", "targets": [ { "datasource": { @@ -383,6 +522,10 @@ "type": "stat" }, { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, "description": "This is the total number of IPv4 nodes gossiped in the last 5 days. Does not mean we were able to connect to them.", "fieldConfig": { "defaults": { @@ -421,10 +564,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "8.3.3", + "pluginVersion": "10.4.0", "targets": [ { "datasource": { @@ -443,6 +588,10 @@ "type": "stat" }, { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, "description": "This is the total number of IPv6 nodes gossiped in the last 5 days. Does not mean we were able to connect to them.", "fieldConfig": { "defaults": { @@ -481,10 +630,12 @@ "fields": "", "values": false }, + "showPercentChange": false, "text": {}, - "textMode": "auto" + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "8.3.3", + "pluginVersion": "10.4.0", "targets": [ { "datasource": { @@ -503,6 +654,10 @@ "type": "stat" }, { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, "gridPos": { "h": 1, "w": 24, @@ -510,10 +665,23 @@ "y": 12 }, "id": 16, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, + "refId": "A" + } + ], "title": "Version Distribution", "type": "row" }, { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, "description": "Shows the percentage of peers that have been discovered on each version.\n\nNote that the version AFTER the currently released version may also show up due to peers running dev versions of the software.", "fieldConfig": { "defaults": { @@ -545,6 +713,7 @@ "legend": { "displayMode": "list", "placement": "bottom", + "showLegend": true, "values": [ "percent" ] @@ -558,7 +727,8 @@ "values": false }, "tooltip": { - "mode": "single" + "mode": "single", + "sort": "none" } }, "targets": [ @@ -578,6 +748,95 @@ "type": "piechart" }, { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, + "description": "Shows the fraction of peers discovered that run a version recent enough to support the 2.1 hard fork", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [] + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 5, + "x": 7, + "y": 13 + }, + "id": 30, + "options": { + "displayLabels": [ + "percent" + ], + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true, + "values": [ + "percent" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(max by (version) (chia_crawler_peer_version{network=\"$network\", version =~ \"[2-9]\\\\.[1-9][0-9]*\\\\.[0-9]+.*\"}))", + "interval": "", + "legendFormat": "ready for hard fork", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, + "editorMode": "code", + "expr": "sum(max by (version) (chia_crawler_peer_version{network=\"$network\", version !~ \"[2-9]\\\\.[1-9][0-9]*\\\\.[0-9]+.*\"}))", + "hide": false, + "instant": false, + "legendFormat": "not ready", + "range": true, + "refId": "B" + } + ], + "title": "Hard fork readiness", + "type": "piechart" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, "description": "Shows the number of peers that have been discovered on each version.\n\nNote that the version AFTER the currently released version may also show up due to peers running dev versions of the software.", "fieldConfig": { "defaults": { @@ -599,17 +858,22 @@ }, "gridPos": { "h": 12, - "w": 17, - "x": 7, + "w": 12, + "x": 12, "y": 13 }, "id": 2, "options": { "displayMode": "lcd", "legend": { + "showLegend": true, "sort": "current", "sortDesc": false }, + "maxVizHeight": 300, + "minVizHeight": 16, + "minVizWidth": 8, + "namePlacement": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ @@ -619,9 +883,11 @@ "values": false }, "showUnfilled": true, - "text": {} + "sizing": "auto", + "text": {}, + "valueMode": "color" }, - "pluginVersion": "8.3.3", + "pluginVersion": "10.4.0", "targets": [ { "datasource": { @@ -640,6 +906,10 @@ }, { "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, "gridPos": { "h": 1, "w": 24, @@ -649,6 +919,10 @@ "id": 14, "panels": [ { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, "description": "", "fieldConfig": { "defaults": { @@ -688,8 +962,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -704,14 +977,15 @@ "h": 24, "w": 24, "x": 0, - "y": 26 + "y": 34 }, "id": 10, "options": { "legend": { "calcs": [], "displayMode": "list", - "placement": "bottom" + "placement": "bottom", + "showLegend": true }, "tooltip": { "mode": "single" @@ -734,10 +1008,23 @@ "type": "timeseries" } ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, + "refId": "A" + } + ], "title": "Version History", "type": "row" }, { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, "gridPos": { "h": 1, "w": 24, @@ -745,10 +1032,23 @@ "y": 26 }, "id": 12, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, + "refId": "A" + } + ], "title": "Nodes", "type": "row" }, { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, "description": "This is the total number of nodes gossiped in the last 5 days. Does not mean we were able to connect to them.", "fieldConfig": { "defaults": { @@ -756,6 +1056,9 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, @@ -767,6 +1070,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -811,10 +1115,12 @@ "legend": { "calcs": [], "displayMode": "list", - "placement": "bottom" + "placement": "bottom", + "showLegend": true }, "tooltip": { - "mode": "single" + "mode": "single", + "sort": "none" } }, "targets": [ @@ -834,6 +1140,10 @@ "type": "timeseries" }, { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, "description": "Nodes with available connections are nodes that allow inbound connections and have available space for more peers to connect", "fieldConfig": { "defaults": { @@ -841,6 +1151,9 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, @@ -852,6 +1165,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -896,10 +1210,12 @@ "legend": { "calcs": [], "displayMode": "list", - "placement": "bottom" + "placement": "bottom", + "showLegend": true }, "tooltip": { - "mode": "single" + "mode": "single", + "sort": "none" } }, "targets": [ @@ -919,6 +1235,10 @@ "type": "timeseries" }, { + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, "description": "This is the total number of IPv6 nodes gossiped in the last 5 days. Does not mean we were able to connect to them.", "fieldConfig": { "defaults": { @@ -926,6 +1246,9 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, @@ -937,6 +1260,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, @@ -981,10 +1305,12 @@ "legend": { "calcs": [], "displayMode": "list", - "placement": "bottom" + "placement": "bottom", + "showLegend": true }, "tooltip": { - "mode": "single" + "mode": "single", + "sort": "none" } }, "targets": [ @@ -1005,18 +1331,21 @@ } ], "refresh": "", - "schemaVersion": 34, - "style": "dark", + "schemaVersion": 39, "tags": [], "templating": { "list": [ { "allValue": ".*", "current": { - "selected": false, + "selected": true, "text": "mainnet", "value": "mainnet" }, + "datasource": { + "type": "prometheus", + "uid": "PB06BBC9CA81C548D" + }, "definition": "label_values({application=\"chia-blockchain\",component=\"dns-introducer\"}, network)", "description": "The network to filter results by", "hide": 0, @@ -1045,6 +1374,6 @@ "timezone": "", "title": "Peer Info", "uid": "em15uQ47k", - "version": 12, + "version": 4, "weekStart": "" }