Files
Claude-Code-Monitor/monitoring/grafana/dashboards/ccam-overview.json
T
nntrivi2001 57dc91585d feat: Claude Code Monitor — lanes, pipelines and a merged workspace
Internal SmartGift build of a Claude Code monitoring dashboard.

Lanes: a durable unit of parallel agent work, one per working directory,
tracked across session restarts. Managed lanes are git worktrees the
dashboard provisions and can reset or remove behind a three-check destroy
guard and a counted preflight; adopted lanes are directories you already
own and are never destroyable.

Pipelines: a lane moves through pipeline stages. A stage the agent declares
with evidence renders green; a stage inferred from the tool-event stream
renders dashed amber and never counts as done. Detection is forward-only
within a 30-minute window, and never writes the declared stage.

Workspace: one page at /run with a lane grid, the selected lane's pipeline,
and a full Claude console behind a disclosure.
2026-07-30 14:39:03 +07:00

856 lines
25 KiB
JSON

{
"uid": "ccam-overview",
"title": "CCAM — Overview",
"description": "Live metrics scraped from GET /api/metrics on each 15s interval. Every value is read from your SQLite database at scrape time — no sample or synthetic data.",
"tags": ["ccam", "claude-code"],
"timezone": "browser",
"schemaVersion": 39,
"version": 2,
"editable": true,
"refresh": "15s",
"time": { "from": "now-24h", "to": "now" },
"links": [
{
"title": "Sessions & Agents",
"type": "link",
"url": "/d/ccam-sessions-agents/ccam-sessions-agents",
"keepTime": true
},
{
"title": "Tokens & Events",
"type": "link",
"url": "/d/ccam-tokens-events/ccam-tokens-events",
"keepTime": true
},
{
"title": "Platform Health",
"type": "link",
"url": "/d/ccam-platform/ccam-platform",
"keepTime": true
},
{
"title": "Prometheus — total sessions",
"type": "link",
"icon": "external link",
"url": "http://localhost:9090/graph?g0.expr=sum(ccam_sessions)&g0.tab=0",
"targetBlank": true,
"keepTime": true
},
{
"title": "Prometheus — event total",
"type": "link",
"icon": "external link",
"url": "http://localhost:9090/graph?g0.expr=ccam_events_total&g0.tab=0",
"targetBlank": true,
"keepTime": true
}
],
"templating": { "list": [] },
"annotations": { "list": [] },
"panels": [
{
"id": 100,
"type": "row",
"title": "Live fleet",
"collapsed": false,
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }
},
{
"id": 1,
"type": "stat",
"title": "Active sessions",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 4, "w": 4, "x": 0, "y": 1 },
"options": {
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
"colorMode": "value",
"graphMode": "area",
"textMode": "auto",
"justifyMode": "auto"
},
"fieldConfig": {
"defaults": {
"unit": "none",
"color": { "mode": "thresholds" },
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] }
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_sessions{status=\"active\"}",
"legendFormat": "active"
}
]
},
{
"id": 2,
"type": "stat",
"title": "Working agents",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 4, "w": 4, "x": 4, "y": 1 },
"options": {
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
"colorMode": "value",
"graphMode": "area",
"textMode": "auto",
"justifyMode": "auto"
},
"fieldConfig": {
"defaults": {
"unit": "none",
"color": { "mode": "thresholds" },
"thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }] }
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_agents{status=\"working\"}",
"legendFormat": "working"
}
]
},
{
"id": 3,
"type": "stat",
"title": "Realtime clients",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 4, "w": 4, "x": 8, "y": 1 },
"options": {
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
"colorMode": "value",
"graphMode": "area",
"textMode": "auto",
"justifyMode": "auto"
},
"fieldConfig": {
"defaults": {
"unit": "none",
"color": { "mode": "thresholds" },
"thresholds": { "mode": "absolute", "steps": [{ "color": "purple", "value": null }] }
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_websocket_clients",
"legendFormat": "clients"
}
]
},
{
"id": 4,
"type": "stat",
"title": "Enabled remote sources",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 4, "w": 4, "x": 12, "y": 1 },
"options": {
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
"colorMode": "value",
"graphMode": "none",
"textMode": "auto",
"justifyMode": "auto"
},
"fieldConfig": {
"defaults": {
"unit": "none",
"color": { "mode": "thresholds" },
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] }
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_remote_sources{enabled=\"true\"}",
"legendFormat": "enabled"
}
]
},
{
"id": 12,
"type": "stat",
"title": "Scrape healthy",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 4, "w": 4, "x": 16, "y": 1 },
"options": {
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
"colorMode": "background",
"graphMode": "none",
"textMode": "value",
"justifyMode": "center"
},
"fieldConfig": {
"defaults": {
"mappings": [
{
"type": "value",
"options": {
"0": { "text": "DOWN", "color": "red" },
"1": { "text": "UP", "color": "green" }
}
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{ "color": "red", "value": null },
{ "color": "green", "value": 1 }
]
}
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_up",
"legendFormat": "up"
}
]
},
{
"id": 13,
"type": "stat",
"title": "Total sessions",
"description": "Sum of all session statuses in the database (active + completed + error + abandoned).",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 4, "w": 4, "x": 20, "y": 1 },
"options": {
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
"colorMode": "value",
"graphMode": "area",
"textMode": "auto",
"justifyMode": "auto"
},
"fieldConfig": {
"defaults": {
"unit": "none",
"decimals": 0,
"color": { "mode": "thresholds" },
"thresholds": { "mode": "absolute", "steps": [{ "color": "orange", "value": null }] }
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "sum(ccam_sessions)",
"legendFormat": "total"
}
]
},
{
"id": 101,
"type": "row",
"title": "Database totals (cumulative — from your SQLite history)",
"collapsed": false,
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 5 }
},
{
"id": 14,
"type": "stat",
"title": "Completed sessions",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 4, "w": 4, "x": 0, "y": 6 },
"options": {
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
"colorMode": "value",
"graphMode": "area",
"textMode": "auto",
"justifyMode": "auto"
},
"fieldConfig": {
"defaults": {
"unit": "none",
"decimals": 0,
"color": { "mode": "thresholds" },
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] }
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_sessions{status=\"completed\"}",
"legendFormat": "completed"
}
]
},
{
"id": 15,
"type": "stat",
"title": "Error sessions",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 4, "w": 4, "x": 4, "y": 6 },
"options": {
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
"colorMode": "value",
"graphMode": "area",
"textMode": "auto",
"justifyMode": "auto"
},
"fieldConfig": {
"defaults": {
"unit": "none",
"decimals": 0,
"color": { "mode": "thresholds" },
"thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }] }
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_sessions{status=\"error\"}",
"legendFormat": "error"
}
]
},
{
"id": 16,
"type": "stat",
"title": "Total events",
"description": "Monotonic counter since the database was created.",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 4, "w": 4, "x": 8, "y": 6 },
"options": {
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
"colorMode": "value",
"graphMode": "area",
"textMode": "auto",
"justifyMode": "auto"
},
"fieldConfig": {
"defaults": {
"unit": "short",
"decimals": 0,
"color": { "mode": "thresholds" },
"thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }] }
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_events_total",
"legendFormat": "events"
}
]
},
{
"id": 17,
"type": "stat",
"title": "Input tokens",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 4, "w": 4, "x": 12, "y": 6 },
"options": {
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
"colorMode": "value",
"graphMode": "area",
"textMode": "auto",
"justifyMode": "auto"
},
"fieldConfig": {
"defaults": {
"unit": "short",
"decimals": 1,
"color": { "mode": "thresholds" },
"thresholds": { "mode": "absolute", "steps": [{ "color": "yellow", "value": null }] }
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_tokens_total{kind=\"input\"}",
"legendFormat": "input"
}
]
},
{
"id": 18,
"type": "stat",
"title": "Output tokens",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 4, "w": 4, "x": 16, "y": 6 },
"options": {
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
"colorMode": "value",
"graphMode": "area",
"textMode": "auto",
"justifyMode": "auto"
},
"fieldConfig": {
"defaults": {
"unit": "short",
"decimals": 1,
"color": { "mode": "thresholds" },
"thresholds": { "mode": "absolute", "steps": [{ "color": "orange", "value": null }] }
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_tokens_total{kind=\"output\"}",
"legendFormat": "output"
}
]
},
{
"id": 19,
"type": "stat",
"title": "All tokens (sum)",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 4, "w": 4, "x": 20, "y": 6 },
"options": {
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
"colorMode": "value",
"graphMode": "area",
"textMode": "auto",
"justifyMode": "auto"
},
"fieldConfig": {
"defaults": {
"unit": "short",
"decimals": 1,
"color": { "mode": "thresholds" },
"thresholds": { "mode": "absolute", "steps": [{ "color": "purple", "value": null }] }
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "sum(ccam_tokens_total)",
"legendFormat": "tokens"
}
]
},
{
"id": 102,
"type": "row",
"title": "Breakdown",
"collapsed": false,
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 10 }
},
{
"id": 20,
"type": "piechart",
"title": "Sessions by status",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 8, "w": 8, "x": 0, "y": 11 },
"options": {
"legend": { "displayMode": "table", "placement": "right", "values": ["value", "percent"] },
"pieType": "donut",
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
"tooltip": { "mode": "single" }
},
"fieldConfig": {
"defaults": { "unit": "none", "decimals": 0 },
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_sessions",
"legendFormat": "{{status}}",
"instant": true
}
]
},
{
"id": 21,
"type": "bargauge",
"title": "Token totals by kind",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 8, "w": 8, "x": 8, "y": 11 },
"options": {
"orientation": "horizontal",
"displayMode": "gradient",
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
"showUnfilled": true
},
"fieldConfig": {
"defaults": {
"unit": "short",
"decimals": 1,
"color": { "mode": "palette-classic" },
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] }
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_tokens_total",
"legendFormat": "{{kind}}",
"instant": true
}
]
},
{
"id": 22,
"type": "bargauge",
"title": "Agents by status",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 8, "w": 8, "x": 16, "y": 11 },
"options": {
"orientation": "horizontal",
"displayMode": "gradient",
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
"showUnfilled": true
},
"fieldConfig": {
"defaults": {
"unit": "none",
"decimals": 0,
"color": { "mode": "palette-classic" },
"thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }] }
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_agents",
"legendFormat": "{{status}}",
"instant": true
}
]
},
{
"id": 103,
"type": "row",
"title": "Over time",
"collapsed": false,
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 19 }
},
{
"id": 5,
"type": "timeseries",
"title": "Sessions by status",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 20 },
"options": {
"legend": { "displayMode": "list", "placement": "bottom", "calcs": [] },
"tooltip": { "mode": "multi", "sort": "desc" }
},
"fieldConfig": {
"defaults": {
"unit": "none",
"color": { "mode": "palette-classic" },
"custom": {
"drawStyle": "line",
"lineWidth": 2,
"fillOpacity": 10,
"showPoints": "never",
"stacking": { "mode": "none", "group": "A" }
}
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_sessions",
"legendFormat": "{{status}}"
}
]
},
{
"id": 6,
"type": "timeseries",
"title": "Agents by status",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 20 },
"options": {
"legend": { "displayMode": "list", "placement": "bottom", "calcs": [] },
"tooltip": { "mode": "multi", "sort": "desc" }
},
"fieldConfig": {
"defaults": {
"unit": "none",
"color": { "mode": "palette-classic" },
"custom": {
"drawStyle": "line",
"lineWidth": 2,
"fillOpacity": 10,
"showPoints": "never",
"stacking": { "mode": "none", "group": "A" }
}
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_agents",
"legendFormat": "{{status}}"
}
]
},
{
"id": 23,
"type": "timeseries",
"title": "Cumulative events (database total)",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 28 },
"options": {
"legend": { "displayMode": "list", "placement": "bottom", "calcs": ["lastNotNull"] },
"tooltip": { "mode": "single", "sort": "none" }
},
"fieldConfig": {
"defaults": {
"unit": "short",
"decimals": 0,
"color": { "mode": "palette-classic" },
"custom": {
"drawStyle": "line",
"lineWidth": 2,
"fillOpacity": 20,
"showPoints": "never",
"stacking": { "mode": "none", "group": "A" }
}
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_events_total",
"legendFormat": "events"
}
]
},
{
"id": 24,
"type": "timeseries",
"title": "Cumulative tokens by kind",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 28 },
"options": {
"legend": { "displayMode": "list", "placement": "bottom", "calcs": ["lastNotNull"] },
"tooltip": { "mode": "multi", "sort": "desc" }
},
"fieldConfig": {
"defaults": {
"unit": "short",
"color": { "mode": "palette-classic" },
"custom": {
"drawStyle": "line",
"lineWidth": 2,
"fillOpacity": 10,
"showPoints": "never",
"stacking": { "mode": "none", "group": "A" }
}
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_tokens_total",
"legendFormat": "{{kind}}"
}
]
},
{
"id": 104,
"type": "row",
"title": "Rates (need a few scrape intervals)",
"collapsed": false,
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 36 }
},
{
"id": 7,
"type": "timeseries",
"title": "Event throughput (events/sec)",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 37 },
"options": {
"legend": { "displayMode": "list", "placement": "bottom", "calcs": [] },
"tooltip": { "mode": "single", "sort": "none" }
},
"fieldConfig": {
"defaults": {
"unit": "ops",
"color": { "mode": "palette-classic" },
"custom": {
"drawStyle": "line",
"lineWidth": 2,
"fillOpacity": 15,
"showPoints": "never"
}
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "rate(ccam_events_total[5m])",
"legendFormat": "events/s"
}
]
},
{
"id": 8,
"type": "timeseries",
"title": "Token usage rate by kind (tokens/sec)",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 37 },
"options": {
"legend": { "displayMode": "list", "placement": "bottom", "calcs": [] },
"tooltip": { "mode": "multi", "sort": "desc" }
},
"fieldConfig": {
"defaults": {
"unit": "none",
"color": { "mode": "palette-classic" },
"custom": {
"drawStyle": "line",
"lineWidth": 2,
"fillOpacity": 10,
"showPoints": "never"
}
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "rate(ccam_tokens_total[5m])",
"legendFormat": "{{kind}}"
}
]
},
{
"id": 105,
"type": "row",
"title": "Process",
"collapsed": false,
"gridPos": { "h": 1, "w": 24, "x": 0, "y": 45 }
},
{
"id": 9,
"type": "stat",
"title": "Server uptime",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 6, "w": 6, "x": 0, "y": 46 },
"options": {
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
"colorMode": "value",
"graphMode": "none",
"textMode": "auto",
"justifyMode": "auto"
},
"fieldConfig": {
"defaults": {
"unit": "s",
"color": { "mode": "thresholds" },
"thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] }
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_process_uptime_seconds",
"legendFormat": "uptime"
}
]
},
{
"id": 10,
"type": "stat",
"title": "Server memory (RSS)",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 6, "w": 6, "x": 6, "y": 46 },
"options": {
"reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
"colorMode": "value",
"graphMode": "area",
"textMode": "auto",
"justifyMode": "auto"
},
"fieldConfig": {
"defaults": {
"unit": "bytes",
"color": { "mode": "thresholds" },
"thresholds": { "mode": "absolute", "steps": [{ "color": "blue", "value": null }] }
},
"overrides": []
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_process_resident_memory_bytes",
"legendFormat": "rss"
}
]
},
{
"id": 11,
"type": "table",
"title": "Build info",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"gridPos": { "h": 6, "w": 12, "x": 12, "y": 46 },
"options": { "showHeader": true },
"fieldConfig": {
"defaults": {},
"overrides": [
{
"matcher": { "id": "byName", "options": "Value" },
"properties": [{ "id": "custom.hidden", "value": true }]
},
{
"matcher": { "id": "byName", "options": "Time" },
"properties": [{ "id": "custom.hidden", "value": true }]
},
{
"matcher": { "id": "byName", "options": "job" },
"properties": [{ "id": "custom.hidden", "value": true }]
}
]
},
"targets": [
{
"refId": "A",
"datasource": { "type": "prometheus", "uid": "ccam-prometheus" },
"expr": "ccam_build_info",
"format": "table",
"instant": true
}
]
}
]
}