{
  "annotations": {
    "list": []
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": null,
  "links": [
    {
      "asDropdown": false,
      "icon": "external link",
      "includeVars": false,
      "keepTime": false,
      "tags": [],
      "targetBlank": false,
      "title": "Home",
      "tooltip": "Return to saorsalabs.com",
      "type": "link",
      "url": "https://saorsalabs.com"
    }
  ],
  "panels": [
    {
      "datasource": {"type": "prometheus", "uid": "prometheus"},
      "fieldConfig": {
        "defaults": {
          "color": {"mode": "thresholds"},
          "mappings": [],
          "max": 1,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {"color": "red", "value": null},
              {"color": "yellow", "value": 0.9},
              {"color": "green", "value": 0.95}
            ]
          },
          "unit": "percentunit"
        }
      },
      "gridPos": {"h": 8, "w": 6, "x": 0, "y": 0},
      "id": 1,
      "options": {
        "orientation": "auto",
        "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "title": "NAT Traversal Success Rate",
      "type": "gauge",
      "targets": [{
        "expr": "sum(rate(ant_quic_nat_traversal_attempts_total{result=\"success\"}[5m])) / sum(rate(ant_quic_nat_traversal_attempts_total[5m]))",
        "refId": "A"
      }]
    },
    {
      "datasource": {"type": "prometheus", "uid": "prometheus"},
      "fieldConfig": {
        "defaults": {
          "color": {"mode": "palette-classic"},
          "custom": {"hideFrom": {"legend": false, "tooltip": false, "viz": false}},
          "mappings": []
        }
      },
      "gridPos": {"h": 8, "w": 6, "x": 6, "y": 0},
      "id": 2,
      "options": {
        "displayLabels": ["name", "percent"],
        "legend": {"displayMode": "list", "placement": "right"},
        "pieType": "pie",
        "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}
      },
      "title": "Connections by NAT Type",
      "type": "piechart",
      "targets": [{
        "expr": "sum by (nat_type) (ant_quic_connections_total)",
        "legendFormat": "{{nat_type}}",
        "refId": "A"
      }]
    },
    {
      "datasource": {"type": "prometheus", "uid": "prometheus"},
      "fieldConfig": {
        "defaults": {
          "color": {"mode": "palette-classic"},
          "mappings": [],
          "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
          "unit": "short"
        }
      },
      "gridPos": {"h": 8, "w": 6, "x": 12, "y": 0},
      "id": 3,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
        "textMode": "auto"
      },
      "title": "Active Connections",
      "type": "stat",
      "targets": [{
        "expr": "sum(ant_quic_connections_active)",
        "refId": "A"
      }]
    },
    {
      "datasource": {"type": "prometheus", "uid": "prometheus"},
      "fieldConfig": {
        "defaults": {
          "color": {"mode": "palette-classic"},
          "mappings": [],
          "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
          "unit": "short"
        }
      },
      "gridPos": {"h": 8, "w": 6, "x": 18, "y": 0},
      "id": 4,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
        "textMode": "auto"
      },
      "title": "Active Nodes",
      "type": "stat",
      "targets": [{
        "expr": "count(up{job=\"ant-quic\"})",
        "refId": "A"
      }]
    },
    {
      "datasource": {"type": "prometheus", "uid": "prometheus"},
      "fieldConfig": {
        "defaults": {
          "color": {"mode": "palette-classic"},
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {"legend": false, "tooltip": false, "viz": false},
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {"type": "linear"},
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {"group": "A", "mode": "none"},
            "thresholdsStyle": {"mode": "off"}
          },
          "mappings": [],
          "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
          "unit": "s"
        }
      },
      "gridPos": {"h": 8, "w": 12, "x": 0, "y": 8},
      "id": 5,
      "options": {"legend": {"calcs": [], "displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "single", "sort": "none"}},
      "title": "Message Latency (p99)",
      "type": "timeseries",
      "targets": [{
        "expr": "histogram_quantile(0.99, sum(rate(ant_quic_message_latency_seconds_bucket[5m])) by (le))",
        "legendFormat": "p99",
        "refId": "A"
      }, {
        "expr": "histogram_quantile(0.95, sum(rate(ant_quic_message_latency_seconds_bucket[5m])) by (le))",
        "legendFormat": "p95",
        "refId": "B"
      }, {
        "expr": "histogram_quantile(0.50, sum(rate(ant_quic_message_latency_seconds_bucket[5m])) by (le))",
        "legendFormat": "p50",
        "refId": "C"
      }]
    },
    {
      "datasource": {"type": "prometheus", "uid": "prometheus"},
      "fieldConfig": {
        "defaults": {
          "color": {"mode": "palette-classic"},
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {"legend": false, "tooltip": false, "viz": false},
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {"type": "linear"},
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {"group": "A", "mode": "none"},
            "thresholdsStyle": {"mode": "off"}
          },
          "mappings": [],
          "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]},
          "unit": "s"
        }
      },
      "gridPos": {"h": 8, "w": 12, "x": 12, "y": 8},
      "id": 6,
      "options": {"legend": {"calcs": [], "displayMode": "list", "placement": "bottom"}, "tooltip": {"mode": "single", "sort": "none"}},
      "title": "NAT Traversal Duration",
      "type": "timeseries",
      "targets": [{
        "expr": "histogram_quantile(0.99, sum(rate(ant_quic_nat_traversal_duration_seconds_bucket[5m])) by (le))",
        "legendFormat": "p99",
        "refId": "A"
      }, {
        "expr": "histogram_quantile(0.50, sum(rate(ant_quic_nat_traversal_duration_seconds_bucket[5m])) by (le))",
        "legendFormat": "p50",
        "refId": "B"
      }]
    },
    {
      "datasource": {"type": "prometheus", "uid": "prometheus"},
      "fieldConfig": {
        "defaults": {
          "color": {"mode": "palette-classic"},
          "custom": {
            "align": "auto",
            "displayMode": "auto",
            "inspect": false
          },
          "mappings": [],
          "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}]}
        },
        "overrides": [{
          "matcher": {"id": "byName", "options": "Success Rate"},
          "properties": [{
            "id": "custom.displayMode",
            "value": "color-background"
          }, {
            "id": "thresholds",
            "value": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "yellow", "value": 0.8}, {"color": "green", "value": 0.95}]}
          }, {
            "id": "unit",
            "value": "percentunit"
          }]
        }]
      },
      "gridPos": {"h": 10, "w": 24, "x": 0, "y": 16},
      "id": 7,
      "options": {"footer": {"enablePagination": false, "fields": [], "reducer": ["sum"], "show": false}, "showHeader": true},
      "title": "NAT Traversal Matrix",
      "type": "table",
      "targets": [{
        "expr": "sum by (initiator_nat, responder_nat) (rate(ant_quic_nat_traversal_attempts_total{result=\"success\"}[1h])) / sum by (initiator_nat, responder_nat) (rate(ant_quic_nat_traversal_attempts_total[1h]))",
        "format": "table",
        "instant": true,
        "refId": "A"
      }],
      "transformations": [{
        "id": "organize",
        "options": {"excludeByName": {"Time": true}, "indexByName": {}, "renameByName": {"Value": "Success Rate", "initiator_nat": "From NAT", "responder_nat": "To NAT"}}
      }]
    }
  ],
  "refresh": "10s",
  "schemaVersion": 38,
  "style": "dark",
  "tags": ["ant-quic", "nat-traversal", "designer-flow"],
  "templating": {"list": []},
  "time": {"from": "now-1h", "to": "now"},
  "timepicker": {},
  "timezone": "browser",
  "title": "ant-quic NAT Traversal",
  "uid": "ant-quic-nat",
  "version": 1,
  "weekStart": ""
}
