add histograms for peer connections and reachability #8

Merged
shyba merged 1 commit from dht_histograms into master 2022-09-02 16:59:29 +02:00
2 changed files with 239 additions and 114 deletions

View file

@ -322,7 +322,7 @@
"uid": "PBFA97CFB590B2093" "uid": "PBFA97CFB590B2093"
}, },
"exemplar": true, "exemplar": true,
"expr": "dht_crawler_node_unique_total_hosts", "expr": "avg(dht_crawler_node_unique_total_hosts)",
"interval": "", "interval": "",
"legendFormat": "", "legendFormat": "",
"refId": "A" "refId": "A"
@ -386,7 +386,7 @@
"uid": "PBFA97CFB590B2093" "uid": "PBFA97CFB590B2093"
}, },
"exemplar": true, "exemplar": true,
"expr": "dht_crawler_node_working_streams_total / dht_crawler_node_probed_streams_total", "expr": "avg(dht_crawler_node_working_streams_total / dht_crawler_node_probed_streams_total)",
"interval": "", "interval": "",
"legendFormat": "", "legendFormat": "",
"refId": "A" "refId": "A"
@ -576,7 +576,8 @@
"uid": "PBFA97CFB590B2093" "uid": "PBFA97CFB590B2093"
}, },
"exemplar": true, "exemplar": true,
"expr": "rate(dht_crawler_node_announced_streams_total[1h]) / rate(dht_crawler_node_probed_streams_total[1h])", "expr": "rate(dht_crawler_node_announced_streams_total[2h]) / rate(dht_crawler_node_probed_streams_total[2h])",
"hide": false,
"interval": "", "interval": "",
"legendFormat": "Announced (1h)", "legendFormat": "Announced (1h)",
"refId": "A" "refId": "A"
@ -587,8 +588,8 @@
"uid": "PBFA97CFB590B2093" "uid": "PBFA97CFB590B2093"
}, },
"exemplar": true, "exemplar": true,
"expr": "dht_crawler_node_working_streams_total / dht_crawler_node_probed_streams_total", "expr": "sum(dht_crawler_node_working_streams_total) / sum(dht_crawler_node_probed_streams_total)",
"hide": false, "hide": true,
"interval": "", "interval": "",
"legendFormat": "Reachable", "legendFormat": "Reachable",
"refId": "B" "refId": "B"
@ -599,8 +600,8 @@
"uid": "PBFA97CFB590B2093" "uid": "PBFA97CFB590B2093"
}, },
"exemplar": true, "exemplar": true,
"expr": "dht_crawler_node_announced_streams_total / dht_crawler_node_probed_streams_total", "expr": "sum(dht_crawler_node_announced_streams_total) / sum(dht_crawler_node_probed_streams_total)",
"hide": false, "hide": true,
"interval": "", "interval": "",
"legendFormat": "Announced", "legendFormat": "Announced",
"refId": "C" "refId": "C"
@ -611,7 +612,7 @@
"uid": "PBFA97CFB590B2093" "uid": "PBFA97CFB590B2093"
}, },
"exemplar": true, "exemplar": true,
"expr": "rate(dht_crawler_node_working_streams_total[1h]) / rate(dht_crawler_node_probed_streams_total[1h])", "expr": "rate(dht_crawler_node_working_streams_total[2h]) / rate(dht_crawler_node_probed_streams_total[2h])",
"hide": false, "hide": false,
"interval": "", "interval": "",
"legendFormat": "Reachable (1h)", "legendFormat": "Reachable (1h)",
@ -1266,11 +1267,38 @@
"type": "row" "type": "row"
}, },
{ {
"datasource": null,
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"color": { "color": {
"mode": "thresholds" "mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
}, },
"mappings": [], "mappings": [],
"thresholds": { "thresholds": {
@ -1286,75 +1314,21 @@
"overrides": [] "overrides": []
}, },
"gridPos": { "gridPos": {
"h": 5, "h": 8,
"w": 3, "w": 12,
"x": 0, "x": 0,
"y": 67 "y": 78
},
"id": 2,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"exemplar": true,
"expr": "dht_node_peers_in_routing_table",
"interval": "",
"legendFormat": "known peers",
"refId": "A"
}
],
"title": "DHT Node Peers",
"type": "stat"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 6,
"x": 3,
"y": 67
}, },
"id": 38, "id": 38,
"options": { "options": {
"colorMode": "value", "colorMode": "value",
"graphMode": "area", "graphMode": "area",
"justifyMode": "auto", "justifyMode": "auto",
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"orientation": "auto", "orientation": "auto",
"reduceOptions": { "reduceOptions": {
"calcs": [ "calcs": [
@ -1364,7 +1338,11 @@
"values": false "values": false
}, },
"text": {}, "text": {},
"textMode": "auto" "textMode": "auto",
"tooltip": {
"mode": "single",
"sort": "none"
}
}, },
"pluginVersion": "8.2.2", "pluginVersion": "8.2.2",
"targets": [ "targets": [
@ -1374,29 +1352,85 @@
"uid": "PBFA97CFB590B2093" "uid": "PBFA97CFB590B2093"
}, },
"exemplar": true, "exemplar": true,
"expr": "dht_node_storing_peers", "expr": "histogram_quantile(0.999, sum(rate(dht_crawler_node_connections_found_bucket{}[120m])) by (le, instance)) ",
"hide": true,
"interval": "", "interval": "",
"legendFormat": "known peers", "legendFormat": "99.9%",
"refId": "A" "refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"exemplar": true,
"expr": "histogram_quantile(0.99, sum(rate(dht_crawler_node_connections_found_bucket{}[120m])) by (le, instance)) ",
"hide": false,
"interval": "",
"legendFormat": "99%",
"refId": "B"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"exemplar": true,
"expr": "histogram_quantile(0.5, sum(rate(dht_crawler_node_connections_found_bucket{}[120m])) by (le, instance)) ",
"hide": false,
"interval": "",
"legendFormat": "50%",
"refId": "C"
} }
], ],
"title": "DHT Announcing Peers", "title": "Connections Found",
"type": "stat" "type": "timeseries"
}, },
{ {
"datasource": null,
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"color": { "color": {
"mode": "thresholds" "mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
}, },
"mappings": [], "mappings": [],
"thresholds": { "thresholds": {
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
{ {
"color": "blue", "color": "green",
"value": null "value": null
},
{
"color": "red",
"value": 80
} }
] ]
} }
@ -1404,16 +1438,21 @@
"overrides": [] "overrides": []
}, },
"gridPos": { "gridPos": {
"h": 5, "h": 8,
"w": 6, "w": 11,
"x": 9, "x": 12,
"y": 67 "y": 78
}, },
"id": 40, "id": 40,
"options": { "options": {
"colorMode": "value", "colorMode": "value",
"graphMode": "area", "graphMode": "area",
"justifyMode": "auto", "justifyMode": "auto",
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"orientation": "auto", "orientation": "auto",
"reduceOptions": { "reduceOptions": {
"calcs": [ "calcs": [
@ -1423,7 +1462,11 @@
"values": false "values": false
}, },
"text": {}, "text": {},
"textMode": "auto" "textMode": "auto",
"tooltip": {
"mode": "single",
"sort": "none"
}
}, },
"pluginVersion": "8.2.2", "pluginVersion": "8.2.2",
"targets": [ "targets": [
@ -1433,56 +1476,113 @@
"uid": "PBFA97CFB590B2093" "uid": "PBFA97CFB590B2093"
}, },
"exemplar": true, "exemplar": true,
"expr": "dht_node_stored_blobs", "expr": "histogram_quantile(0.999, sum(rate(dht_crawler_node_reachable_connections_found_bucket{}[120m])) by (le, instance)) ",
"hide": true,
"interval": "", "interval": "",
"legendFormat": "known peers", "legendFormat": "99.9%",
"refId": "A" "refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"exemplar": true,
"expr": "histogram_quantile(0.99, sum(rate(dht_crawler_node_reachable_connections_found_bucket{}[120m])) by (le, instance)) ",
"hide": false,
"interval": "",
"legendFormat": "99%",
"refId": "B"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"exemplar": true,
"expr": "histogram_quantile(0.5, sum(rate(dht_crawler_node_reachable_connections_found_bucket{}[120m])) by (le, instance)) ",
"hide": false,
"interval": "",
"legendFormat": "50%",
"refId": "C"
} }
], ],
"title": "DHT Total Stored Blobs", "title": "Reachable Connections",
"type": "stat" "type": "timeseries"
}, },
{ {
"datasource": null, "datasource": null,
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"color": { "color": {
"mode": "thresholds" "mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"axisSoftMin": 0,
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
}, },
"mappings": [], "mappings": [],
"thresholds": { "thresholds": {
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
{ {
"color": "blue", "color": "green",
"value": null "value": null
},
{
"color": "red",
"value": 80
} }
] ]
} },
"unit": "percentunit"
}, },
"overrides": [] "overrides": []
}, },
"gridPos": { "gridPos": {
"h": 5, "h": 8,
"w": 4, "w": 12,
"x": 15, "x": 0,
"y": 67 "y": 86
}, },
"id": 39, "id": 48,
"options": { "options": {
"colorMode": "value", "legend": {
"graphMode": "area", "calcs": [],
"justifyMode": "auto", "displayMode": "list",
"orientation": "auto", "placement": "bottom"
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
}, },
"text": {}, "text": {},
"textMode": "auto" "textMode": "auto",
"tooltip": {
"mode": "single",
"sort": "none"
}
}, },
"pluginVersion": "8.2.2", "pluginVersion": "8.2.2",
"targets": [ "targets": [
@ -1492,14 +1592,39 @@
"uid": "PBFA97CFB590B2093" "uid": "PBFA97CFB590B2093"
}, },
"exemplar": true, "exemplar": true,
"expr": "sum(dht_node_peer_x_bit_colliding) * 256", "expr": "1.0 - ((histogram_quantile(0.999, sum(rate(dht_crawler_node_connections_found_bucket{}[120m])) by (le, instance))) - (histogram_quantile(0.999, sum(rate(dht_crawler_node_reachable_connections_found_bucket{}[120m])) by (le, instance)))) / (histogram_quantile(0.999, sum(rate(dht_crawler_node_connections_found_bucket{}[120m])) by (le, instance)))",
"hide": true,
"interval": "", "interval": "",
"legendFormat": "known peers", "legendFormat": "99.9%",
"refId": "A" "refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"exemplar": true,
"expr": "1.0 - ((histogram_quantile(0.99, sum(rate(dht_crawler_node_connections_found_bucket{}[120m])) by (le, instance))) - (histogram_quantile(0.99, sum(rate(dht_crawler_node_reachable_connections_found_bucket{}[120m])) by (le, instance)))) / (histogram_quantile(0.99, sum(rate(dht_crawler_node_connections_found_bucket{}[120m])) by (le, instance)))",
"hide": false,
"interval": "",
"legendFormat": "99%",
"refId": "B"
},
{
"datasource": {
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"exemplar": true,
"expr": "1.0 - ((histogram_quantile(0.5, sum(rate(dht_crawler_node_connections_found_bucket{}[120m])) by (le, instance))) - (histogram_quantile(0.5, sum(rate(dht_crawler_node_reachable_connections_found_bucket{}[120m])) by (le, instance)))) / (histogram_quantile(0.5, sum(rate(dht_crawler_node_connections_found_bucket{}[120m])) by (le, instance)))",
"hide": false,
"interval": "",
"legendFormat": "50%",
"refId": "C"
} }
], ],
"title": "DHT Peers estimated from old method", "title": "Reachable Fraction",
"type": "stat" "type": "timeseries"
} }
], ],
"refresh": "15m", "refresh": "15m",
@ -1517,5 +1642,5 @@
"timezone": "", "timezone": "",
"title": "LBRY", "title": "LBRY",
"uid": "zqY5GYO7k", "uid": "zqY5GYO7k",
"version": 3 "version": 7
} }

View file

@ -45,7 +45,7 @@ services:
# - 4444:4444/udp # - 4444:4444/udp
dht-crawler: dht-crawler:
image: lbry/dht-bootstrap:crawler_with_hosting # metrics at port 8080 image: lbry/dht-bootstrap:crawler_with_hostingv2 # metrics at port 8080
entrypoint: python3 entrypoint: python3
command: scripts/dht_crawler.py /database/data.db command: scripts/dht_crawler.py /database/data.db
container_name: dht_node_crawler container_name: dht_node_crawler