{
  "uid": "fleet-bottleneck",
  "title": "Fleet Bottleneck & Visibility",
  "description": "Ranked bottlenecks (Top 10) + capacity, account, and token-spend visibility for the autonomous Claude Code worker fleet. Source: fleet_bottleneck.py /metrics (namespace fleet_). On a fresh up.sh stack the token-spend tiles read No data until a session audit returns rows (run python tools/session_audit.py discover --all); see the First run note at the top.",
  "tags": [
    "fleet",
    "bottleneck",
    "observability"
  ],
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 1,
  "schemaVersion": 39,
  "version": 1,
  "refresh": "30s",
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {},
  "links": [],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "grafana",
          "uid": "-- Grafana --"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "templating": {
    "list": [
      {
        "name": "DS_PROMETHEUS",
        "label": "Prometheus",
        "type": "datasource",
        "query": "prometheus",
        "current": {},
        "hide": 2,
        "refresh": 1,
        "regex": "",
        "options": [],
        "includeAll": false,
        "multi": false
      }
    ]
  },
  "panels": [
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "First run: why some panels read No data",
      "description": "Why the token-spend tiles can read No data on a fresh up.sh stack, and how to populate them.",
      "type": "text",
      "id": 1,
      "gridPos": {
        "h": 5,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "fieldConfig": {
        "defaults": {},
        "overrides": []
      },
      "options": {
        "mode": "markdown",
        "content": "Bringing the stack up with `tools/grafana/up.sh` and driving the hinted `/v1/fak/syscall` smoke request populates the gateway counters but NOT the token-spend tiles below. Those read a **session audit** over local Claude Code transcripts:\n\n- **Token spend (cost & cache) row** (Window cost, Cost/session-hr, Median cache-hit, Median I:O, Transcripts analyzed, Top spenders, Lowest cache-hit): Populated by `session_audit` over `~/.claude/projects`. Empty if no transcripts match the namespace filter (default `C--work`); run `python tools/session_audit.py discover --all` to check.\n\nEverything else here is fed by `fleet_bottleneck.py /metrics` and fills in as the fleet runs. No panel is broken; the empty ones are waiting on the audit pass, not on traffic."
      },
      "pluginVersion": "11.5.2"
    },
    {
      "type": "row",
      "title": "Fleet health",
      "id": 2,
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 5
      },
      "panels": []
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Health",
      "description": "0 OK \u00b7 1 DEGRADED \u00b7 2 CRITICAL \u00b7 3 DOWN (no telemetry).",
      "type": "stat",
      "id": 3,
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 0,
        "y": 6
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "type": "value",
              "options": {
                "0": {
                  "text": "OK",
                  "color": "green",
                  "index": 0
                },
                "1": {
                  "text": "DEGRADED",
                  "color": "yellow",
                  "index": 1
                },
                "2": {
                  "text": "CRITICAL",
                  "color": "red",
                  "index": 2
                },
                "3": {
                  "text": "DOWN",
                  "color": "dark-red",
                  "index": 3
                }
              }
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "yellow",
                "value": 1
              },
              {
                "color": "red",
                "value": 2
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "textMode": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_health_state",
          "refId": "A"
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "#1 bottleneck score",
      "description": "Score of the most-likely actual limiter right now.",
      "type": "stat",
      "id": 4,
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 4,
        "y": 6
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "blue",
                "value": 30
              },
              {
                "color": "yellow",
                "value": 55
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "textMode": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_headline_score",
          "refId": "A"
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Active workers",
      "description": "In-flight workers (not cleanly finished).",
      "type": "stat",
      "id": 5,
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 8,
        "y": 6
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "textMode": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_workers_active",
          "refId": "A"
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Accounts throttled",
      "description": "Accounts currently rate-limited.",
      "type": "stat",
      "id": 6,
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 12,
        "y": 6
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 1
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "textMode": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_accounts_throttled",
          "refId": "A"
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Auth-blocked workers",
      "description": "Workers that need /login (a human must re-auth).",
      "type": "stat",
      "id": 7,
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 16,
        "y": 6
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 1
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "textMode": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_workers_auth_blocked",
          "refId": "A"
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Telemetry age",
      "description": "Age of the session registry \u2014 stale = flying blind (#8).",
      "type": "stat",
      "id": 8,
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 20,
        "y": 6
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "yellow",
                "value": 15
              },
              {
                "color": "red",
                "value": 30
              }
            ]
          },
          "unit": "m"
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "textMode": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_registry_age_minutes",
          "refId": "A"
        }
      ]
    },
    {
      "type": "row",
      "title": "Ranked bottlenecks (the Top 10)",
      "id": 9,
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 10
      },
      "panels": []
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Bottleneck scores (ranked)",
      "description": "Every scored class, 0-100 - likelihood it is the actual limiter. Empty until at least one of the Top 10 classes fires; a fresh fleet with no active workers scores nothing, which is healthy, not broken.",
      "type": "bargauge",
      "id": 10,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 11
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "blue",
                "value": 30
              },
              {
                "color": "yellow",
                "value": 55
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "short",
          "max": 100,
          "min": 0
        },
        "overrides": []
      },
      "options": {
        "displayMode": "gradient",
        "orientation": "horizontal",
        "showUnfilled": true,
        "minVizHeight": 10,
        "minVizWidth": 0,
        "valueMode": "color",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_bottleneck_score",
          "legendFormat": "{{title}}",
          "instant": true,
          "refId": "A"
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Bottleneck detail",
      "description": "Title / layer / score (score color = severity band) for each scored class. Empty until a bottleneck class fires.",
      "type": "table",
      "id": 11,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 12,
        "y": 11
      },
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": "auto",
            "filterable": true
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "score"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green",
                      "value": null
                    },
                    {
                      "color": "blue",
                      "value": 30
                    },
                    {
                      "color": "yellow",
                      "value": 55
                    },
                    {
                      "color": "red",
                      "value": 80
                    }
                  ]
                }
              },
              {
                "id": "custom.cellOptions",
                "value": {
                  "type": "color-text"
                }
              }
            ]
          }
        ]
      },
      "options": {
        "showHeader": true,
        "sortBy": [
          {
            "displayName": "score",
            "desc": true
          }
        ]
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_bottleneck_score",
          "format": "table",
          "instant": true,
          "refId": "A"
        }
      ],
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Time": true,
              "__name__": true,
              "id": true,
              "instance": true,
              "job": true,
              "fleet": true
            },
            "renameByName": {
              "Value": "score"
            },
            "indexByName": {
              "title": 0,
              "layer": 1,
              "score": 2
            }
          }
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Bottleneck score history",
      "description": "How each class's score moves over time. A flat/empty chart means no class has scored over the window.",
      "type": "timeseries",
      "id": 12,
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 20
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 10,
            "showPoints": "never",
            "axisPlacement": "auto",
            "spanNulls": true,
            "pointSize": 5,
            "stacking": {
              "mode": "none"
            }
          },
          "unit": "short",
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "calcs": []
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_bottleneck_score",
          "legendFormat": "{{title}}",
          "refId": "A"
        }
      ]
    },
    {
      "type": "row",
      "title": "Capacity & accounts",
      "id": 13,
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 28
      },
      "panels": []
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Worker states over time",
      "description": "The in-flight worker buckets that drive #1-#10.",
      "type": "timeseries",
      "id": 14,
      "gridPos": {
        "h": 8,
        "w": 16,
        "x": 0,
        "y": 29
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "drawStyle": "line",
            "lineWidth": 1,
            "fillOpacity": 10,
            "showPoints": "never",
            "axisPlacement": "auto",
            "spanNulls": true,
            "pointSize": 5,
            "stacking": {
              "mode": "none"
            }
          },
          "unit": "short",
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "options": {
        "legend": {
          "displayMode": "list",
          "placement": "bottom",
          "calcs": []
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_workers_active",
          "legendFormat": "active",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_workers_hanging",
          "legendFormat": "hanging",
          "refId": "B"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_workers_auth_blocked",
          "legendFormat": "auth-blocked",
          "refId": "C"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_workers_on_throttled_account",
          "legendFormat": "on throttled acct",
          "refId": "D"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_resume_queue",
          "legendFormat": "resume queue",
          "refId": "E"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_surface_backlog",
          "legendFormat": "surface backlog",
          "refId": "F"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_api_error_stalls",
          "legendFormat": "api-error stalls",
          "refId": "G"
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Active workers per account",
      "description": "Concentration on one account = imbalance (#7) + throttle blast radius (#1).",
      "type": "bargauge",
      "id": 15,
      "gridPos": {
        "h": 8,
        "w": 8,
        "x": 16,
        "y": 29
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "options": {
        "displayMode": "gradient",
        "orientation": "horizontal",
        "showUnfilled": true,
        "minVizHeight": 10,
        "minVizWidth": 0,
        "valueMode": "color",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_workers_active_per_account",
          "legendFormat": "{{account}}",
          "instant": true,
          "refId": "A"
        }
      ]
    },
    {
      "type": "row",
      "title": "Token spend (cost & cache)",
      "id": 16,
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 37
      },
      "panels": []
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Window cost",
      "description": "Estimated token spend over the audit window (assumed pricing). Populated by `session_audit` over `~/.claude/projects`. Empty if no transcripts match the namespace filter (default `C--work`); run `python tools/session_audit.py discover --all` to check.",
      "type": "stat",
      "id": 17,
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 0,
        "y": 38
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "currencyUSD"
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "textMode": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_cost_usd",
          "refId": "A"
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Cost / session-hr",
      "description": "Estimated cost per active session-hour. Populated by `session_audit` over `~/.claude/projects`. Empty if no transcripts match the namespace filter (default `C--work`); run `python tools/session_audit.py discover --all` to check.",
      "type": "stat",
      "id": 18,
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 4,
        "y": 38
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "currencyUSD"
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "textMode": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_cost_per_active_session_hour",
          "refId": "A"
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Median cache-hit",
      "description": "Median per-session prompt-cache-hit fraction - low = token waste (#6). Populated by `session_audit` over `~/.claude/projects`. Empty if no transcripts match the namespace filter (default `C--work`); run `python tools/session_audit.py discover --all` to check.",
      "type": "stat",
      "id": 19,
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 8,
        "y": 38
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "yellow",
                "value": 0.8
              },
              {
                "color": "green",
                "value": 0.9
              }
            ]
          },
          "unit": "percentunit"
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "textMode": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_cache_hit_ratio_median",
          "refId": "A"
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Median I:O",
      "description": "Median per-session input:output token ratio. Populated by `session_audit` over `~/.claude/projects`. Empty if no transcripts match the namespace filter (default `C--work`); run `python tools/session_audit.py discover --all` to check.",
      "type": "stat",
      "id": 20,
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 12,
        "y": 38
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "textMode": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_io_ratio_median",
          "refId": "A"
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Transcripts analyzed",
      "description": "Sessions in the token-spend pass. 0/No data when the audit matched nothing. Populated by `session_audit` over `~/.claude/projects`. Empty if no transcripts match the namespace filter (default `C--work`); run `python tools/session_audit.py discover --all` to check.",
      "type": "stat",
      "id": 21,
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 16,
        "y": 38
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "textMode": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_audit_sessions",
          "refId": "A"
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Bottlenecks scored",
      "description": "How many of the Top 10 classes are firing now.",
      "type": "stat",
      "id": 22,
      "gridPos": {
        "h": 4,
        "w": 4,
        "x": 20,
        "y": 38
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "textMode": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_bottlenecks",
          "refId": "A"
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Top spenders (output tokens)",
      "description": "The heaviest sessions by output tokens (leaderboard). Populated by `session_audit` over `~/.claude/projects`. Empty if no transcripts match the namespace filter (default `C--work`); run `python tools/session_audit.py discover --all` to check.",
      "type": "bargauge",
      "id": 23,
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 43
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "options": {
        "displayMode": "gradient",
        "orientation": "horizontal",
        "showUnfilled": true,
        "minVizHeight": 10,
        "minVizWidth": 0,
        "valueMode": "color",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_top_spender_output_tokens",
          "legendFormat": "{{session}}",
          "instant": true,
          "refId": "A"
        }
      ]
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "title": "Lowest cache-hit sessions",
      "description": "Token-waste suspects - sessions with the lowest cache reuse (#6). Populated by `session_audit` over `~/.claude/projects`. Empty if no transcripts match the namespace filter (default `C--work`); run `python tools/session_audit.py discover --all` to check.",
      "type": "bargauge",
      "id": 24,
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 43
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "yellow",
                "value": 0.8
              },
              {
                "color": "green",
                "value": 0.9
              }
            ]
          },
          "unit": "percentunit"
        },
        "overrides": []
      },
      "options": {
        "displayMode": "gradient",
        "orientation": "horizontal",
        "showUnfilled": true,
        "minVizHeight": 10,
        "minVizWidth": 0,
        "valueMode": "color",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        }
      },
      "pluginVersion": "11.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "fleet_worst_cache_hit_ratio",
          "legendFormat": "{{session}}",
          "instant": true,
          "refId": "A"
        }
      ]
    }
  ]
}
