Skip to content

Commit

Permalink
swarm: implement blackhole detection (#2320)
Browse files Browse the repository at this point in the history
* swarm: implement blackhole detection

* address review comments
  • Loading branch information
sukunrt authored Jun 27, 2023
1 parent e5334ed commit 1e31d70
Show file tree
Hide file tree
Showing 9 changed files with 810 additions and 4 deletions.
254 changes: 253 additions & 1 deletion dashboards/swarm/swarm.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@
"name": "Prometheus",
"version": "1.0.0"
},
{
"type": "panel",
"id": "stat",
"name": "Stat",
"version": ""
},
{
"type": "panel",
"id": "state-timeline",
"name": "State timeline",
"version": ""
},
{
"type": "panel",
"id": "timeseries",
Expand Down Expand Up @@ -3026,8 +3038,248 @@
],
"title": "Dials per connection",
"type": "piechart"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 84
},
"id": 44,
"panels": [],
"title": "Black Hole Detection",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "fixed"
},
"custom": {
"fillOpacity": 76,
"lineWidth": 0,
"spanNulls": true
},
"mappings": [
{
"options": {
"0": {
"color": "blue",
"index": 0,
"text": "Probing"
},
"1": {
"color": "green",
"index": 1,
"text": "Allowed"
},
"2": {
"color": "purple",
"index": 2,
"text": "Blocked"
}
},
"type": "value"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 24,
"x": 0,
"y": 85
},
"id": 46,
"options": {
"alignValue": "center",
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"mergeValues": true,
"rowHeight": 0.9,
"showValue": "always",
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "libp2p_swarm_black_hole_filter_state{instance=~\"$instance\"}",
"legendFormat": "{{instance}} {{name}}",
"range": true,
"refId": "A"
}
],
"title": "Black Hole Filter State",
"type": "state-timeline"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"fixedColor": "purple",
"mode": "fixed"
},
"mappings": [
{
"options": {
"0": {
"index": 0,
"text": "-"
}
},
"type": "value"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 91
},
"id": 49,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "value_and_name"
},
"pluginVersion": "9.3.6",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "libp2p_swarm_black_hole_filter_next_request_allowed_after{instance=~\"$instance\"}",
"legendFormat": "{{instance}}: {{name}}",
"range": true,
"refId": "A"
}
],
"title": "Black Hole Filter Requests Till Next Probe",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"max": 10,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "purple",
"value": null
},
{
"color": "green",
"value": 5
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 91
},
"id": 47,
"options": {
"orientation": "vertical",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showThresholdLabels": false,
"showThresholdMarkers": true
},
"pluginVersion": "9.3.6",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"exemplar": false,
"expr": "libp2p_swarm_black_hole_filter_success_fraction{instance=~\"$instance\"} * 100",
"instant": true,
"legendFormat": "{{instance}} {{name}}",
"range": false,
"refId": "A"
}
],
"title": "Black Hole Filter Success Percentage",
"type": "gauge"
}
],
"refresh": false,
"schemaVersion": 37,
"style": "dark",
"tags": [],
Expand Down Expand Up @@ -3075,6 +3327,6 @@
"timezone": "",
"title": "libp2p Swarm",
"uid": "a15PyhO4z",
"version": 6,
"version": 7,
"weekStart": ""
}
Loading

0 comments on commit 1e31d70

Please sign in to comment.