diff --git a/nix/host-modules/swarm-grafana/dashboards/agents.json b/nix/host-modules/swarm-grafana/dashboards/agents.json index 760b40ab..39f0ba95 100644 --- a/nix/host-modules/swarm-grafana/dashboards/agents.json +++ b/nix/host-modules/swarm-grafana/dashboards/agents.json @@ -1479,73 +1479,6 @@ } } }, - "panel-50": { - "kind": "Panel", - "spec": { - "id": 50, - "title": "Active agents", - "description": "Distinct agents with Claude Code activity in the selected range.", - "links": [], - "data": { - "kind": "QueryGroup", - "spec": { - "queries": [ - { - "kind": "PanelQuery", - "spec": { - "query": { - "kind": "DataQuery", - "group": "prometheus", - "version": "v0", - "datasource": { - "name": "@datasourceUid@" - }, - "spec": { - "expr": "count(count by (agent) ({__name__=\"claude_code.session.count\", hive=~\"$hive\", agent=~\"$agent\"}))", - "instant": true, - "legendFormat": "agents" - } - }, - "refId": "A", - "hidden": false - } - } - ], - "transformations": [], - "queryOptions": {} - } - }, - "vizConfig": { - "kind": "VizConfig", - "group": "stat", - "version": "", - "spec": { - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "value" - }, - "fieldConfig": { - "defaults": { - "unit": "short", - "decimals": 0, - "color": { - "mode": "fixed", - "fixedColor": "text" - } - }, - "overrides": [] - } - } - } - } - }, "panel-51": { "kind": "Panel", "spec": { @@ -1613,73 +1546,6 @@ } } }, - "panel-52": { - "kind": "Panel", - "spec": { - "id": 52, - "title": "Tokens", - "description": "Total tokens (all types) in the selected range.", - "links": [], - "data": { - "kind": "QueryGroup", - "spec": { - "queries": [ - { - "kind": "PanelQuery", - "spec": { - "query": { - "kind": "DataQuery", - "group": "prometheus", - "version": "v0", - "datasource": { - "name": "@datasourceUid@" - }, - "spec": { - "expr": "sum(increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))", - "instant": true, - "legendFormat": "tokens" - } - }, - "refId": "A", - "hidden": false - } - } - ], - "transformations": [], - "queryOptions": {} - } - }, - "vizConfig": { - "kind": "VizConfig", - "group": "stat", - "version": "", - "spec": { - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "value" - }, - "fieldConfig": { - "defaults": { - "unit": "short", - "decimals": 1, - "color": { - "mode": "fixed", - "fixedColor": "text" - } - }, - "overrides": [] - } - } - } - } - }, "panel-53": { "kind": "Panel", "spec": { @@ -1881,73 +1747,6 @@ } } }, - "panel-56": { - "kind": "Panel", - "spec": { - "id": 56, - "title": "Cost", - "description": "Total USD spent in the selected range.", - "links": [], - "data": { - "kind": "QueryGroup", - "spec": { - "queries": [ - { - "kind": "PanelQuery", - "spec": { - "query": { - "kind": "DataQuery", - "group": "prometheus", - "version": "v0", - "datasource": { - "name": "@datasourceUid@" - }, - "spec": { - "expr": "sum(increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))", - "instant": true, - "legendFormat": "cost" - } - }, - "refId": "A", - "hidden": false - } - } - ], - "transformations": [], - "queryOptions": {} - } - }, - "vizConfig": { - "kind": "VizConfig", - "group": "stat", - "version": "", - "spec": { - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "value" - }, - "fieldConfig": { - "defaults": { - "unit": "currencyUSD", - "decimals": 2, - "color": { - "mode": "fixed", - "fixedColor": "text" - } - }, - "overrides": [] - } - } - } - } - }, "panel-60": { "kind": "Panel", "spec": { @@ -2333,175 +2132,6 @@ "kind": "TabsLayout", "spec": { "tabs": [ - { - "kind": "TabsLayoutTab", - "spec": { - "title": "overview", - "layout": { - "kind": "GridLayout", - "spec": { - "items": [ - { - "kind": "GridLayoutItem", - "spec": { - "x": 0, - "y": 0, - "width": 3, - "height": 4, - "element": { - "kind": "ElementReference", - "name": "panel-50" - } - } - }, - { - "kind": "GridLayoutItem", - "spec": { - "x": 3, - "y": 0, - "width": 3, - "height": 4, - "element": { - "kind": "ElementReference", - "name": "panel-51" - } - } - }, - { - "kind": "GridLayoutItem", - "spec": { - "x": 6, - "y": 0, - "width": 4, - "height": 4, - "element": { - "kind": "ElementReference", - "name": "panel-52" - } - } - }, - { - "kind": "GridLayoutItem", - "spec": { - "x": 10, - "y": 0, - "width": 4, - "height": 4, - "element": { - "kind": "ElementReference", - "name": "panel-53" - } - } - }, - { - "kind": "GridLayoutItem", - "spec": { - "x": 14, - "y": 0, - "width": 3, - "height": 4, - "element": { - "kind": "ElementReference", - "name": "panel-54" - } - } - }, - { - "kind": "GridLayoutItem", - "spec": { - "x": 17, - "y": 0, - "width": 3, - "height": 4, - "element": { - "kind": "ElementReference", - "name": "panel-55" - } - } - }, - { - "kind": "GridLayoutItem", - "spec": { - "x": 20, - "y": 0, - "width": 4, - "height": 4, - "element": { - "kind": "ElementReference", - "name": "panel-56" - } - } - }, - { - "kind": "GridLayoutItem", - "spec": { - "x": 0, - "y": 4, - "width": 12, - "height": 8, - "element": { - "kind": "ElementReference", - "name": "panel-60" - } - } - }, - { - "kind": "GridLayoutItem", - "spec": { - "x": 12, - "y": 4, - "width": 12, - "height": 8, - "element": { - "kind": "ElementReference", - "name": "panel-61" - } - } - }, - { - "kind": "GridLayoutItem", - "spec": { - "x": 0, - "y": 12, - "width": 8, - "height": 8, - "element": { - "kind": "ElementReference", - "name": "panel-62" - } - } - }, - { - "kind": "GridLayoutItem", - "spec": { - "x": 8, - "y": 12, - "width": 8, - "height": 8, - "element": { - "kind": "ElementReference", - "name": "panel-63" - } - } - }, - { - "kind": "GridLayoutItem", - "spec": { - "x": 16, - "y": 12, - "width": 8, - "height": 8, - "element": { - "kind": "ElementReference", - "name": "panel-64" - } - } - } - ] - } - } - } - }, { "kind": "TabsLayoutTab", "spec": { @@ -2561,6 +2191,32 @@ "name": "panel-32" } } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 0, + "y": 11, + "width": 24, + "height": 4, + "element": { + "kind": "ElementReference", + "name": "panel-51" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 0, + "y": 15, + "width": 24, + "height": 8, + "element": { + "kind": "ElementReference", + "name": "panel-60" + } + } } ] } @@ -2626,6 +2282,97 @@ "name": "panel-21" } } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 0, + "y": 12, + "width": 8, + "height": 4, + "element": { + "kind": "ElementReference", + "name": "panel-53" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 8, + "y": 12, + "width": 8, + "height": 4, + "element": { + "kind": "ElementReference", + "name": "panel-54" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 16, + "y": 12, + "width": 8, + "height": 4, + "element": { + "kind": "ElementReference", + "name": "panel-55" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 0, + "y": 16, + "width": 12, + "height": 7, + "element": { + "kind": "ElementReference", + "name": "panel-61" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 12, + "y": 16, + "width": 12, + "height": 7, + "element": { + "kind": "ElementReference", + "name": "panel-62" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 0, + "y": 23, + "width": 12, + "height": 7, + "element": { + "kind": "ElementReference", + "name": "panel-63" + } + } + }, + { + "kind": "GridLayoutItem", + "spec": { + "x": 12, + "y": 23, + "width": 12, + "height": 7, + "element": { + "kind": "ElementReference", + "name": "panel-64" + } + } } ] }