Skip to content

Commit 1e31d70

Browse files
authored
swarm: implement blackhole detection (#2320)
* swarm: implement blackhole detection * address review comments
1 parent e5334ed commit 1e31d70

File tree

9 files changed

+810
-4
lines changed

9 files changed

+810
-4
lines changed

dashboards/swarm/swarm.json

Lines changed: 253 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@
3535
"name": "Prometheus",
3636
"version": "1.0.0"
3737
},
38+
{
39+
"type": "panel",
40+
"id": "stat",
41+
"name": "Stat",
42+
"version": ""
43+
},
44+
{
45+
"type": "panel",
46+
"id": "state-timeline",
47+
"name": "State timeline",
48+
"version": ""
49+
},
3850
{
3951
"type": "panel",
4052
"id": "timeseries",
@@ -3026,8 +3038,248 @@
30263038
],
30273039
"title": "Dials per connection",
30283040
"type": "piechart"
3041+
},
3042+
{
3043+
"collapsed": false,
3044+
"gridPos": {
3045+
"h": 1,
3046+
"w": 24,
3047+
"x": 0,
3048+
"y": 84
3049+
},
3050+
"id": 44,
3051+
"panels": [],
3052+
"title": "Black Hole Detection",
3053+
"type": "row"
3054+
},
3055+
{
3056+
"datasource": {
3057+
"type": "prometheus",
3058+
"uid": "${DS_PROMETHEUS}"
3059+
},
3060+
"fieldConfig": {
3061+
"defaults": {
3062+
"color": {
3063+
"mode": "fixed"
3064+
},
3065+
"custom": {
3066+
"fillOpacity": 76,
3067+
"lineWidth": 0,
3068+
"spanNulls": true
3069+
},
3070+
"mappings": [
3071+
{
3072+
"options": {
3073+
"0": {
3074+
"color": "blue",
3075+
"index": 0,
3076+
"text": "Probing"
3077+
},
3078+
"1": {
3079+
"color": "green",
3080+
"index": 1,
3081+
"text": "Allowed"
3082+
},
3083+
"2": {
3084+
"color": "purple",
3085+
"index": 2,
3086+
"text": "Blocked"
3087+
}
3088+
},
3089+
"type": "value"
3090+
}
3091+
],
3092+
"thresholds": {
3093+
"mode": "absolute",
3094+
"steps": [
3095+
{
3096+
"color": "green",
3097+
"value": null
3098+
}
3099+
]
3100+
}
3101+
},
3102+
"overrides": []
3103+
},
3104+
"gridPos": {
3105+
"h": 6,
3106+
"w": 24,
3107+
"x": 0,
3108+
"y": 85
3109+
},
3110+
"id": 46,
3111+
"options": {
3112+
"alignValue": "center",
3113+
"legend": {
3114+
"displayMode": "list",
3115+
"placement": "bottom",
3116+
"showLegend": true
3117+
},
3118+
"mergeValues": true,
3119+
"rowHeight": 0.9,
3120+
"showValue": "always",
3121+
"tooltip": {
3122+
"mode": "single",
3123+
"sort": "none"
3124+
}
3125+
},
3126+
"targets": [
3127+
{
3128+
"datasource": {
3129+
"type": "prometheus",
3130+
"uid": "${DS_PROMETHEUS}"
3131+
},
3132+
"editorMode": "code",
3133+
"expr": "libp2p_swarm_black_hole_filter_state{instance=~\"$instance\"}",
3134+
"legendFormat": "{{instance}} {{name}}",
3135+
"range": true,
3136+
"refId": "A"
3137+
}
3138+
],
3139+
"title": "Black Hole Filter State",
3140+
"type": "state-timeline"
3141+
},
3142+
{
3143+
"datasource": {
3144+
"type": "prometheus",
3145+
"uid": "${DS_PROMETHEUS}"
3146+
},
3147+
"fieldConfig": {
3148+
"defaults": {
3149+
"color": {
3150+
"fixedColor": "purple",
3151+
"mode": "fixed"
3152+
},
3153+
"mappings": [
3154+
{
3155+
"options": {
3156+
"0": {
3157+
"index": 0,
3158+
"text": "-"
3159+
}
3160+
},
3161+
"type": "value"
3162+
}
3163+
],
3164+
"thresholds": {
3165+
"mode": "absolute",
3166+
"steps": [
3167+
{
3168+
"color": "green",
3169+
"value": null
3170+
}
3171+
]
3172+
}
3173+
},
3174+
"overrides": []
3175+
},
3176+
"gridPos": {
3177+
"h": 7,
3178+
"w": 12,
3179+
"x": 0,
3180+
"y": 91
3181+
},
3182+
"id": 49,
3183+
"options": {
3184+
"colorMode": "value",
3185+
"graphMode": "none",
3186+
"justifyMode": "auto",
3187+
"orientation": "horizontal",
3188+
"reduceOptions": {
3189+
"calcs": [
3190+
"lastNotNull"
3191+
],
3192+
"fields": "",
3193+
"values": false
3194+
},
3195+
"textMode": "value_and_name"
3196+
},
3197+
"pluginVersion": "9.3.6",
3198+
"targets": [
3199+
{
3200+
"datasource": {
3201+
"type": "prometheus",
3202+
"uid": "${DS_PROMETHEUS}"
3203+
},
3204+
"editorMode": "code",
3205+
"expr": "libp2p_swarm_black_hole_filter_next_request_allowed_after{instance=~\"$instance\"}",
3206+
"legendFormat": "{{instance}}: {{name}}",
3207+
"range": true,
3208+
"refId": "A"
3209+
}
3210+
],
3211+
"title": "Black Hole Filter Requests Till Next Probe",
3212+
"type": "stat"
3213+
},
3214+
{
3215+
"datasource": {
3216+
"type": "prometheus",
3217+
"uid": "${DS_PROMETHEUS}"
3218+
},
3219+
"fieldConfig": {
3220+
"defaults": {
3221+
"color": {
3222+
"mode": "thresholds"
3223+
},
3224+
"mappings": [],
3225+
"max": 10,
3226+
"min": 0,
3227+
"thresholds": {
3228+
"mode": "absolute",
3229+
"steps": [
3230+
{
3231+
"color": "purple",
3232+
"value": null
3233+
},
3234+
{
3235+
"color": "green",
3236+
"value": 5
3237+
}
3238+
]
3239+
}
3240+
},
3241+
"overrides": []
3242+
},
3243+
"gridPos": {
3244+
"h": 7,
3245+
"w": 12,
3246+
"x": 12,
3247+
"y": 91
3248+
},
3249+
"id": 47,
3250+
"options": {
3251+
"orientation": "vertical",
3252+
"reduceOptions": {
3253+
"calcs": [
3254+
"lastNotNull"
3255+
],
3256+
"fields": "",
3257+
"values": false
3258+
},
3259+
"showThresholdLabels": false,
3260+
"showThresholdMarkers": true
3261+
},
3262+
"pluginVersion": "9.3.6",
3263+
"targets": [
3264+
{
3265+
"datasource": {
3266+
"type": "prometheus",
3267+
"uid": "${DS_PROMETHEUS}"
3268+
},
3269+
"editorMode": "code",
3270+
"exemplar": false,
3271+
"expr": "libp2p_swarm_black_hole_filter_success_fraction{instance=~\"$instance\"} * 100",
3272+
"instant": true,
3273+
"legendFormat": "{{instance}} {{name}}",
3274+
"range": false,
3275+
"refId": "A"
3276+
}
3277+
],
3278+
"title": "Black Hole Filter Success Percentage",
3279+
"type": "gauge"
30293280
}
30303281
],
3282+
"refresh": false,
30313283
"schemaVersion": 37,
30323284
"style": "dark",
30333285
"tags": [],
@@ -3075,6 +3327,6 @@
30753327
"timezone": "",
30763328
"title": "libp2p Swarm",
30773329
"uid": "a15PyhO4z",
3078-
"version": 6,
3330+
"version": 7,
30793331
"weekStart": ""
30803332
}

0 commit comments

Comments
 (0)