{ "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" } } } ] }