{
  "annotations": {
    "list": [
      {
        "datasource": {
          "type": "prometheus",
          "uid": "mini"
        },
        "enable": false,
        "iconColor": "red",
        "name": "New annotation"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": 10,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "prometheus",
        "uid": "mini"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "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": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 9,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "mini"
          },
          "editorMode": "builder",
          "exemplar": false,
          "expr": "rate(libp2p_eventbus_events_emitted_total{mini_id=\"$mini_id_value\"}[$__rate_interval])",
          "format": "time_series",
          "instant": false,
          "interval": "",
          "legendFormat": "{{event}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Events Types emitted",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "mini"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "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": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 14,
        "w": 12,
        "x": 0,
        "y": 9
      },
      "id": 12,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "mini"
          },
          "editorMode": "builder",
          "expr": "rate(libp2p_eventbus_subscriber_event_queued{mini_id=\"$mini_id_value\", subscriber_name=~\"$category.*\"}[$__rate_interval])",
          "legendFormat": "{{subscriber_name}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Events emitted By Subscriber",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "mini"
      },
      "description": "Event Subscribers need to consume events quickly enough, otherwise they risk stalling the libp2p process.\nSubscribers use a buffered channel to catch temporary bursts. A queue length that doesn't return to 0 might be indicative of a problem.",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "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": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 14,
        "w": 12,
        "x": 12,
        "y": 9
      },
      "id": 8,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "mini"
          },
          "editorMode": "code",
          "expr": "libp2p_eventbus_subscriber_queue_length{mini_id=\"$mini_id_value\", subscriber_name=~\"$category.*\"}",
          "hide": false,
          "legendFormat": "{{subscriber_name}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Subscriber Queue Length",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "mini"
      },
      "description": "When the subscriber event queue fills up, it blocks the libp2p process. This can be mitigated by\n1. consuming events quickly enough on the subscriber side\n2. using a large enough buffer to absorb bursts",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "continuous-GrYlRd"
          },
          "custom": {
            "fillOpacity": 75,
            "lineWidth": 0,
            "spanNulls": 60000
          },
          "mappings": [
            {
              "options": {
                "0": {
                  "color": "green",
                  "index": 0,
                  "text": "OK"
                },
                "1": {
                  "color": "red",
                  "index": 1,
                  "text": "FULL"
                }
              },
              "type": "value"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "#73BF69",
                "value": null
              }
            ]
          },
          "unit": "string"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 11,
        "w": 24,
        "x": 0,
        "y": 23
      },
      "id": 10,
      "options": {
        "alignValue": "center",
        "legend": {
          "displayMode": "list",
          "placement": "right",
          "showLegend": false
        },
        "mergeValues": true,
        "rowHeight": 0.94,
        "showValue": "always",
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "mini"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "libp2p_eventbus_subscriber_queue_full{mini_id=\"$mini_id_value\", subscriber_name=~\"$category.*\"}",
          "format": "time_series",
          "hide": false,
          "instant": false,
          "legendFormat": "{{subscriber_name}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Subscriber Queue Full",
      "type": "state-timeline"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "mini"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 24,
        "x": 0,
        "y": 34
      },
      "id": 6,
      "options": {
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true,
        "text": {
          "titleSize": 14
        }
      },
      "pluginVersion": "9.4.7",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "mini"
          },
          "editorMode": "builder",
          "expr": "libp2p_eventbus_subscribers_total{mini_id=\"$mini_id_value\"}",
          "legendFormat": "{{event}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "Event Subscribers",
      "type": "gauge"
    }
  ],
  "refresh": "5s",
  "revision": 1,
  "schemaVersion": 38,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": "1",
          "value": "1"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "mini"
        },
        "definition": "label_values(mini_id)",
        "hide": 0,
        "includeAll": false,
        "label": "mini ID",
        "multi": false,
        "name": "mini_id_value",
        "options": [],
        "query": {
          "query": "label_values(mini_id)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "allValue": ".*",
        "current": {
          "selected": true,
          "text": [
            "odb",
            "weshnet"
          ],
          "value": [
            "odb",
            "weshnet"
          ]
        },
        "hide": 1,
        "includeAll": true,
        "label": "category",
        "multi": true,
        "name": "category",
        "options": [
          {
            "selected": false,
            "text": "All",
            "value": "$__all"
          },
          {
            "selected": true,
            "text": "weshnet",
            "value": "weshnet"
          },
          {
            "selected": true,
            "text": "odb",
            "value": "odb"
          }
        ],
        "query": "weshnet, odb",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      }
    ]
  },
  "time": {
    "from": "now-5m",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "libp2p EventBus v3",
  "uid": "l5iK1GyVk",
  "version": 1,
  "weekStart": ""
}
