4aae61297f
Analytics parity phases 2–7 (docs/plans/analytics-parity/), built on
138e706 and ported onto v2.3.1:
- Cost by AI tool (?tool= on cost/analytics/stats/workflows, by_tool,
Codex fast/priority and flex tiers, agenthub_cost_usd_total{tool,model})
- Date ranges (from/to) on cost/analytics/workflows; Analytics range select
with Today / This week (Monday) / This month (1st) / 7d / 30d / 90d / All /
Custom; workflow filters carried into workflow-stats.js (read worker)
- Budgets and cost alerts as alert rule types (alert_rules rebuilt without
its rule_type CHECK), GET /api/budgets/status, rule preview, spend pace,
status-bar budget chip; rules stay editable in place
- Query Explorer (/query, allowlisted sort, CSV/JSON export) and scheduled
reports (report_definitions/report_runs, Settings → Reports)
- Session Replay tab and immutable snapshots (session_snapshots, /snapshot/:token)
- Remote Codex sync, push ingest with a hashed token, privacy redaction and
ignored folders (Settings → Data), Cursor sessions (no cost)
- Read-only MCP server, statusline, Grafana/Prometheus files
Also: resizable sidebar, pet run/wave animations, the workspace home keeps a
half-typed prompt, and the pre-commit hook runs only the related tests for a
small commit.
491 lines
10 KiB
JSON
491 lines
10 KiB
JSON
{
|
|
"uid": "agenthub-sessions-agents",
|
|
"title": "AgentHub — Sessions & agents",
|
|
"description": "Session and agent lifecycle counts from /api/metrics.",
|
|
"tags": ["agenthub"],
|
|
"editable": true,
|
|
"schemaVersion": 39,
|
|
"version": 1,
|
|
"refresh": "30s",
|
|
"time": {
|
|
"from": "now-24h",
|
|
"to": "now"
|
|
},
|
|
"timezone": "browser",
|
|
"templating": {
|
|
"list": [
|
|
{
|
|
"name": "ds",
|
|
"label": "Prometheus",
|
|
"type": "datasource",
|
|
"query": "prometheus",
|
|
"current": {},
|
|
"hide": 0
|
|
}
|
|
]
|
|
},
|
|
"links": [
|
|
{
|
|
"title": "AgentHub boards",
|
|
"type": "dashboards",
|
|
"tags": ["agenthub"],
|
|
"asDropdown": true
|
|
}
|
|
],
|
|
"annotations": {
|
|
"list": []
|
|
},
|
|
"panels": [
|
|
{
|
|
"id": 1,
|
|
"type": "stat",
|
|
"title": "Sessions (all)",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"gridPos": {
|
|
"x": 0,
|
|
"y": 0,
|
|
"w": 6,
|
|
"h": 4
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"expr": "sum(agenthub_sessions)",
|
|
"legendFormat": "__auto",
|
|
"instant": true,
|
|
"range": false
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "none"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"reduceOptions": {
|
|
"calcs": ["lastNotNull"],
|
|
"fields": "",
|
|
"values": false
|
|
},
|
|
"colorMode": "value",
|
|
"graphMode": "area",
|
|
"textMode": "auto"
|
|
}
|
|
},
|
|
{
|
|
"id": 2,
|
|
"type": "stat",
|
|
"title": "Active",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"gridPos": {
|
|
"x": 6,
|
|
"y": 0,
|
|
"w": 6,
|
|
"h": 4
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"expr": "sum(agenthub_sessions{status=\"active\"})",
|
|
"legendFormat": "__auto",
|
|
"instant": true,
|
|
"range": false
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "none"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"reduceOptions": {
|
|
"calcs": ["lastNotNull"],
|
|
"fields": "",
|
|
"values": false
|
|
},
|
|
"colorMode": "value",
|
|
"graphMode": "area",
|
|
"textMode": "auto"
|
|
}
|
|
},
|
|
{
|
|
"id": 3,
|
|
"type": "stat",
|
|
"title": "Errored sessions",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"gridPos": {
|
|
"x": 12,
|
|
"y": 0,
|
|
"w": 6,
|
|
"h": 4
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"expr": "sum(agenthub_sessions{status=\"error\"})",
|
|
"legendFormat": "__auto",
|
|
"instant": true,
|
|
"range": false
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "none",
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"color": "green",
|
|
"value": null
|
|
},
|
|
{
|
|
"color": "red",
|
|
"value": 1
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"reduceOptions": {
|
|
"calcs": ["lastNotNull"],
|
|
"fields": "",
|
|
"values": false
|
|
},
|
|
"colorMode": "value",
|
|
"graphMode": "area",
|
|
"textMode": "auto"
|
|
}
|
|
},
|
|
{
|
|
"id": 4,
|
|
"type": "stat",
|
|
"title": "Waiting agents (need you)",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"gridPos": {
|
|
"x": 18,
|
|
"y": 0,
|
|
"w": 6,
|
|
"h": 4
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"expr": "sum(agenthub_agents{status=\"waiting\"})",
|
|
"legendFormat": "__auto",
|
|
"instant": true,
|
|
"range": false
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "none",
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{
|
|
"color": "green",
|
|
"value": null
|
|
},
|
|
{
|
|
"color": "orange",
|
|
"value": 1
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"reduceOptions": {
|
|
"calcs": ["lastNotNull"],
|
|
"fields": "",
|
|
"values": false
|
|
},
|
|
"colorMode": "value",
|
|
"graphMode": "area",
|
|
"textMode": "auto"
|
|
}
|
|
},
|
|
{
|
|
"id": 5,
|
|
"type": "bargauge",
|
|
"title": "Sessions now, by status",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"gridPos": {
|
|
"x": 0,
|
|
"y": 4,
|
|
"w": 12,
|
|
"h": 7
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"expr": "sum by (status) (agenthub_sessions)",
|
|
"legendFormat": "{{status}}",
|
|
"instant": true,
|
|
"range": false
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "none"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"orientation": "horizontal",
|
|
"displayMode": "gradient",
|
|
"reduceOptions": {
|
|
"calcs": ["lastNotNull"],
|
|
"fields": "",
|
|
"values": false
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 6,
|
|
"type": "bargauge",
|
|
"title": "Agents now, by status",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"gridPos": {
|
|
"x": 12,
|
|
"y": 4,
|
|
"w": 12,
|
|
"h": 7
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"expr": "sum by (status) (agenthub_agents)",
|
|
"legendFormat": "{{status}}",
|
|
"instant": true,
|
|
"range": false
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "none"
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"orientation": "horizontal",
|
|
"displayMode": "gradient",
|
|
"reduceOptions": {
|
|
"calcs": ["lastNotNull"],
|
|
"fields": "",
|
|
"values": false
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 7,
|
|
"type": "timeseries",
|
|
"title": "Active sessions and working agents",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"gridPos": {
|
|
"x": 0,
|
|
"y": 11,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"expr": "sum(agenthub_sessions{status=\"active\"})",
|
|
"legendFormat": "active sessions"
|
|
},
|
|
{
|
|
"refId": "B",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"expr": "sum(agenthub_agents{status=\"working\"})",
|
|
"legendFormat": "working agents"
|
|
},
|
|
{
|
|
"refId": "C",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"expr": "sum(agenthub_agents{status=\"waiting\"})",
|
|
"legendFormat": "waiting agents"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "none",
|
|
"custom": {
|
|
"fillOpacity": 15,
|
|
"lineWidth": 2,
|
|
"stacking": {
|
|
"mode": "none"
|
|
}
|
|
}
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"legend": {
|
|
"displayMode": "list",
|
|
"placement": "bottom"
|
|
},
|
|
"tooltip": {
|
|
"mode": "multi"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 8,
|
|
"type": "timeseries",
|
|
"title": "Sessions finished per hour",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"gridPos": {
|
|
"x": 12,
|
|
"y": 11,
|
|
"w": 12,
|
|
"h": 8
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"expr": "sum by (status) (clamp_min(delta(agenthub_sessions{status=~\"completed|error|abandoned\"}[1h]), 0))",
|
|
"legendFormat": "{{status}}"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "none",
|
|
"custom": {
|
|
"drawStyle": "bars",
|
|
"fillOpacity": 60,
|
|
"stacking": {
|
|
"mode": "normal"
|
|
}
|
|
}
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"legend": {
|
|
"displayMode": "list",
|
|
"placement": "bottom"
|
|
},
|
|
"tooltip": {
|
|
"mode": "multi"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": 9,
|
|
"type": "timeseries",
|
|
"title": "Events per minute",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"gridPos": {
|
|
"x": 0,
|
|
"y": 19,
|
|
"w": 24,
|
|
"h": 7
|
|
},
|
|
"targets": [
|
|
{
|
|
"refId": "A",
|
|
"datasource": {
|
|
"type": "prometheus",
|
|
"uid": "${ds}"
|
|
},
|
|
"expr": "sum(rate(agenthub_events_total[5m])) * 60",
|
|
"legendFormat": "events/min"
|
|
}
|
|
],
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "none",
|
|
"custom": {
|
|
"fillOpacity": 15,
|
|
"lineWidth": 2,
|
|
"stacking": {
|
|
"mode": "none"
|
|
}
|
|
}
|
|
},
|
|
"overrides": []
|
|
},
|
|
"options": {
|
|
"legend": {
|
|
"displayMode": "list",
|
|
"placement": "bottom"
|
|
},
|
|
"tooltip": {
|
|
"mode": "multi"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|