From 7796f538748b3a487bd68d18f609ddd19aac79fe Mon Sep 17 00:00:00 2001 From: atlas Date: Sun, 22 Nov 2026 23:46:43 +0100 Subject: [PATCH] dashboards: filter agents by agent and hosts by host.name, drop the hive variable --- .../swarm-grafana/dashboards/agents.json | 146 +++++++----------- .../swarm-grafana/dashboards/archive.json | 39 ++--- .../swarm-grafana/dashboards/attic.json | 31 +--- .../dashboards/claude-usage.json | 59 +++---- .../swarm-grafana/dashboards/gateway.json | 28 ++-- .../swarm-grafana/dashboards/host.json | 63 +++----- 6 files changed, 129 insertions(+), 237 deletions(-) diff --git a/nix/host-modules/swarm-grafana/dashboards/agents.json b/nix/host-modules/swarm-grafana/dashboards/agents.json index 24abe4312..da0296a16 100644 --- a/nix/host-modules/swarm-grafana/dashboards/agents.json +++ b/nix/host-modules/swarm-grafana/dashboards/agents.json @@ -38,38 +38,6 @@ } ], "variables": [ - { - "kind": "QueryVariable", - "spec": { - "name": "hive", - "current": { - "text": "All", - "value": "$__all" - }, - "label": "Hive", - "hide": "dontHide", - "refresh": "onTimeRangeChanged", - "skipUrlSync": false, - "query": { - "kind": "DataQuery", - "group": "prometheus", - "version": "v0", - "datasource": { - "name": "@datasourceUid@" - }, - "spec": { - "__legacyStringValue": "label_values({__name__=\"hyperhive.container.cpu.percent\"}, hive)" - } - }, - "regex": "", - "sort": "alphabeticalAsc", - "options": [], - "multi": true, - "includeAll": true, - "allValue": ".*", - "allowCustomValue": true - } - }, { "kind": "QueryVariable", "spec": { @@ -90,7 +58,7 @@ "name": "@datasourceUid@" }, "spec": { - "__legacyStringValue": "label_values({__name__=\"hyperhive.container.cpu.percent\", hive=~\"$hive\"}, agent)" + "__legacyStringValue": "label_values({__name__=\"hyperhive.container.cpu.percent\"}, agent)" } }, "regex": "", @@ -146,7 +114,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "count(count by (agent) (last_over_time({__name__=\"hyperhive.container.cpu.percent\", hive=~\"$hive\", agent=~\"$agent\", agent!=\"\"}[$__range])))", + "expr": "count(count by (agent) (last_over_time({__name__=\"hyperhive.container.cpu.percent\", agent=~\"$agent\", agent!=\"\"}[$__range])))", "instant": true, "legendFormat": "agents" } @@ -213,7 +181,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (agent) (rate({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__rate_interval])) * 3600", + "expr": "sum by (agent) (rate({__name__=\"claude_code.cost.usage\", agent=~\"$agent\"}[$__rate_interval])) * 3600", "legendFormat": "{{agent}}" } }, @@ -289,7 +257,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (agent) ({__name__=\"hyperhive.container.cpu.percent\", hive=~\"$hive\", agent=~\"$agent\", agent!=\"\"})", + "expr": "sum by (agent) ({__name__=\"hyperhive.container.cpu.percent\", agent=~\"$agent\", agent!=\"\"})", "legendFormat": "{{agent}}" } }, @@ -363,7 +331,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum(increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))", + "expr": "sum(increase({__name__=\"claude_code.cost.usage\", agent=~\"$agent\"}[$__range]))", "instant": true, "legendFormat": "cost" } @@ -429,7 +397,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (agent) ({__name__=\"container.memory.usage\", hive=~\"$hive\", agent=~\"$agent\", agent!=\"\"})", + "expr": "sum by (agent) ({__name__=\"container.memory.usage\", agent=~\"$agent\", agent!=\"\"})", "legendFormat": "{{agent}}" } }, @@ -502,7 +470,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (model) (rate({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\", type!=\"cacheRead\"}[$__rate_interval])) * 60", + "expr": "sum by (model) (rate({__name__=\"claude_code.token.usage\", agent=~\"$agent\", type!=\"cacheRead\"}[$__rate_interval])) * 60", "legendFormat": "{{model}}" } }, @@ -578,7 +546,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum(increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\", type!=\"cacheRead\"}[$__range]))", + "expr": "sum(increase({__name__=\"claude_code.token.usage\", agent=~\"$agent\", type!=\"cacheRead\"}[$__range]))", "instant": true, "legendFormat": "tokens" } @@ -644,7 +612,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sort_desc(sum by (agent) ({__name__=\"hyperhive.container.storage.usage\", hive=~\"$hive\", agent=~\"$agent\", agent!=\"\"}))", + "expr": "sort_desc(sum by (agent) ({__name__=\"hyperhive.container.storage.usage\", agent=~\"$agent\", agent!=\"\"}))", "instant": true, "legendFormat": "{{agent}}" } @@ -719,7 +687,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (type) (rate({__name__=\"claude_code.lines_of_code.count\", hive=~\"$hive\", agent=~\"$agent\"}[$__rate_interval])) * 60", + "expr": "sum by (type) (rate({__name__=\"claude_code.lines_of_code.count\", agent=~\"$agent\"}[$__rate_interval])) * 60", "legendFormat": "{{type}}" } }, @@ -795,7 +763,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.active_time.total\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])))", + "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.active_time.total\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{agent}}" } @@ -871,7 +839,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (agent) ({__name__=\"hyperhive.agent.claude_md.lines\", hive=~\"$hive\", agent=~\"$agent\"})", + "expr": "sum by (agent) ({__name__=\"hyperhive.agent.claude_md.lines\", agent=~\"$agent\"})", "legendFormat": "{{agent}}" } }, @@ -945,7 +913,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (agent) ({__name__=\"hyperhive.agent.todos.open\", hive=~\"$hive\", agent=~\"$agent\"})", + "expr": "sum by (agent) ({__name__=\"hyperhive.agent.todos.open\", agent=~\"$agent\"})", "legendFormat": "{{agent}}" } }, @@ -1019,7 +987,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum(increase({__name__=\"claude_code.session.count\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))", + "expr": "sum(increase({__name__=\"claude_code.session.count\", agent=~\"$agent\"}[$__range]))", "instant": true, "legendFormat": "sessions" } @@ -1085,7 +1053,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum(increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", agent=~\"$agent\", subagent!=\"\"}[$__range]))", + "expr": "sum(increase({__name__=\"claude_code.cost.usage\", agent=~\"$agent\", subagent!=\"\"}[$__range]))", "instant": true, "legendFormat": "subagent cost" } @@ -1151,7 +1119,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum(increase({__name__=\"claude_code.session.count\", hive=~\"$hive\", agent=~\"$agent\", subagent!=\"\"}[$__range]))", + "expr": "sum(increase({__name__=\"claude_code.session.count\", agent=~\"$agent\", subagent!=\"\"}[$__range]))", "instant": true, "legendFormat": "subagent turns" } @@ -1217,7 +1185,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum(increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", agent=~\"$agent\", subagent!=\"\"}[$__range])) / sum(increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))", + "expr": "sum(increase({__name__=\"claude_code.cost.usage\", agent=~\"$agent\", subagent!=\"\"}[$__range])) / sum(increase({__name__=\"claude_code.cost.usage\", agent=~\"$agent\"}[$__range]))", "instant": true, "legendFormat": "subagent share" } @@ -1283,7 +1251,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sort_desc(sum by (subagent) (increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", agent=~\"$agent\", subagent!=\"\"}[$__range])))", + "expr": "sort_desc(sum by (subagent) (increase({__name__=\"claude_code.cost.usage\", agent=~\"$agent\", subagent!=\"\"}[$__range])))", "instant": true, "legendFormat": "{{subagent}}" } @@ -1359,7 +1327,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", agent=~\"$agent\", subagent!=\"\"}[$__range])))", + "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.cost.usage\", agent=~\"$agent\", subagent!=\"\"}[$__range])))", "instant": true, "legendFormat": "{{agent}}" } @@ -1435,7 +1403,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "count(count by (subagent) (increase({__name__=\"claude_code.session.count\", hive=~\"$hive\", agent=~\"$agent\", subagent!=\"\"}[$__range]) > 0))", + "expr": "count(count by (subagent) (increase({__name__=\"claude_code.session.count\", agent=~\"$agent\", subagent!=\"\"}[$__range]) > 0))", "instant": true, "legendFormat": "distinct subagents" } @@ -1501,7 +1469,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "count by (agent) (count by (agent, subagent) (increase({__name__=\"claude_code.session.count\", hive=~\"$hive\", agent=~\"$agent\", subagent!=\"\"}[$__rate_interval]) > 0))", + "expr": "count by (agent) (count by (agent, subagent) (increase({__name__=\"claude_code.session.count\", agent=~\"$agent\", subagent!=\"\"}[$__rate_interval]) > 0))", "legendFormat": "{{agent}}" } }, @@ -1575,7 +1543,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum(increase({__name__=\"hyperhive.agent.turn.count\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))", + "expr": "sum(increase({__name__=\"hyperhive.agent.turn.count\", agent=~\"$agent\"}[$__range]))", "instant": true, "legendFormat": "turns" } @@ -1642,7 +1610,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum(increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\", type=\"input\"}[$__range]))", + "expr": "sum(increase({__name__=\"claude_code.token.usage\", agent=~\"$agent\", type=\"input\"}[$__range]))", "instant": true, "legendFormat": "input" } @@ -1709,7 +1677,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum(increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\", type=\"output\"}[$__range]))", + "expr": "sum(increase({__name__=\"claude_code.token.usage\", agent=~\"$agent\", type=\"output\"}[$__range]))", "instant": true, "legendFormat": "output" } @@ -1776,7 +1744,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum(increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\", type=\"cacheRead\"}[$__range]))", + "expr": "sum(increase({__name__=\"claude_code.token.usage\", agent=~\"$agent\", type=\"cacheRead\"}[$__range]))", "instant": true, "legendFormat": "cache read" } @@ -1843,7 +1811,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sort_desc(sum by (agent) (increase({__name__=\"hyperhive.agent.turn.count\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])))", + "expr": "sort_desc(sum by (agent) (increase({__name__=\"hyperhive.agent.turn.count\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{agent}}" } @@ -1919,7 +1887,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])))", + "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.cost.usage\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{agent}}" } @@ -1995,7 +1963,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\", type=\"input\"}[$__range])))", + "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.token.usage\", agent=~\"$agent\", type=\"input\"}[$__range])))", "instant": true, "legendFormat": "{{agent}}" } @@ -2071,7 +2039,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\", type=\"output\"}[$__range])))", + "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.token.usage\", agent=~\"$agent\", type=\"output\"}[$__range])))", "instant": true, "legendFormat": "{{agent}}" } @@ -2147,7 +2115,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\", type=\"cacheRead\"}[$__range])))", + "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.token.usage\", agent=~\"$agent\", type=\"cacheRead\"}[$__range])))", "instant": true, "legendFormat": "{{agent}}" } @@ -2223,7 +2191,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sort_desc(sum by (agent) (increase({__name__=\"hyperhive.agent.cost.usage\", hive=~\"$hive\", agent=~\"$agent\", currency=\"USD\"}[$__range])))", + "expr": "sort_desc(sum by (agent) (increase({__name__=\"hyperhive.agent.cost.usage\", agent=~\"$agent\", currency=\"USD\"}[$__range])))", "instant": true, "legendFormat": "{{agent}}" } @@ -2299,7 +2267,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (agent) (rate({__name__=\"hyperhive.agent.cost.usage\", hive=~\"$hive\", agent=~\"$agent\", currency=\"USD\"}[$__rate_interval])) * 3600", + "expr": "sum by (agent) (rate({__name__=\"hyperhive.agent.cost.usage\", agent=~\"$agent\", currency=\"USD\"}[$__rate_interval])) * 3600", "legendFormat": "{{agent}}" } }, @@ -2375,7 +2343,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "max by (agent) ({__name__=\"hyperhive.agent.context.used\", hive=~\"$hive\", agent=~\"$agent\"}) / max by (agent) ({__name__=\"hyperhive.agent.context.size\", hive=~\"$hive\", agent=~\"$agent\"}) * 100", + "expr": "max by (agent) ({__name__=\"hyperhive.agent.context.used\", agent=~\"$agent\"}) / max by (agent) ({__name__=\"hyperhive.agent.context.size\", agent=~\"$agent\"}) * 100", "legendFormat": "{{agent}}" } }, @@ -2450,7 +2418,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (agent) (increase({__name__=\"hyperhive.agent.turn.count\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))", + "expr": "sum by (agent) (increase({__name__=\"hyperhive.agent.turn.count\", agent=~\"$agent\"}[$__range]))", "instant": true, "format": "table" } @@ -2470,7 +2438,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (agent) (increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\", type=\"input\"}[$__range]))", + "expr": "sum by (agent) (increase({__name__=\"claude_code.token.usage\", agent=~\"$agent\", type=\"input\"}[$__range]))", "instant": true, "format": "table" } @@ -2490,7 +2458,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (agent) (increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\", type=\"output\"}[$__range]))", + "expr": "sum by (agent) (increase({__name__=\"claude_code.token.usage\", agent=~\"$agent\", type=\"output\"}[$__range]))", "instant": true, "format": "table" } @@ -2510,7 +2478,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (agent) (increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\", type=\"cacheRead\"}[$__range]))", + "expr": "sum by (agent) (increase({__name__=\"claude_code.token.usage\", agent=~\"$agent\", type=\"cacheRead\"}[$__range]))", "instant": true, "format": "table" } @@ -2530,7 +2498,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (agent) (increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))", + "expr": "sum by (agent) (increase({__name__=\"claude_code.cost.usage\", agent=~\"$agent\"}[$__range]))", "instant": true, "format": "table" } @@ -2646,7 +2614,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum(increase({__name__=\"hyperhive.agent.turn.duration_sum\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])) / sum(increase({__name__=\"hyperhive.agent.turn.duration_count\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))", + "expr": "sum(increase({__name__=\"hyperhive.agent.turn.duration_sum\", agent=~\"$agent\"}[$__range])) / sum(increase({__name__=\"hyperhive.agent.turn.duration_count\", agent=~\"$agent\"}[$__range]))", "instant": true, "legendFormat": "Average turn duration" } @@ -2713,7 +2681,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum(increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\", type=\"cacheRead\"}[$__range])) / sum(increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\", type=~\"input|cacheRead|cacheCreation\"}[$__range]))", + "expr": "sum(increase({__name__=\"claude_code.token.usage\", agent=~\"$agent\", type=\"cacheRead\"}[$__range])) / sum(increase({__name__=\"claude_code.token.usage\", agent=~\"$agent\", type=~\"input|cacheRead|cacheCreation\"}[$__range]))", "instant": true, "legendFormat": "Cache hit rate" } @@ -2780,7 +2748,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum(increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])) / sum(increase({__name__=\"hyperhive.agent.turn.count\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))", + "expr": "sum(increase({__name__=\"claude_code.token.usage\", agent=~\"$agent\"}[$__range])) / sum(increase({__name__=\"hyperhive.agent.turn.count\", agent=~\"$agent\"}[$__range]))", "instant": true, "legendFormat": "Tokens per turn" } @@ -2847,7 +2815,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (agent) (rate({__name__=\"hyperhive.agent.turn.count\", hive=~\"$hive\", agent=~\"$agent\"}[$__rate_interval])) * 3600", + "expr": "sum by (agent) (rate({__name__=\"hyperhive.agent.turn.count\", agent=~\"$agent\"}[$__rate_interval])) * 3600", "legendFormat": "{{agent}}" } }, @@ -2923,7 +2891,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (model) (rate({__name__=\"hyperhive.agent.turn.count\", hive=~\"$hive\", agent=~\"$agent\"}[$__rate_interval])) * 3600", + "expr": "sum by (model) (rate({__name__=\"hyperhive.agent.turn.count\", agent=~\"$agent\"}[$__rate_interval])) * 3600", "legendFormat": "{{model}}" } }, @@ -2999,7 +2967,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "histogram_quantile(0.5, sum by (le) (rate({__name__=\"hyperhive.agent.turn.duration_bucket\", hive=~\"$hive\", agent=~\"$agent\"}[$__rate_interval])))", + "expr": "histogram_quantile(0.5, sum by (le) (rate({__name__=\"hyperhive.agent.turn.duration_bucket\", agent=~\"$agent\"}[$__rate_interval])))", "legendFormat": "p50" } }, @@ -3018,7 +2986,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "histogram_quantile(0.95, sum by (le) (rate({__name__=\"hyperhive.agent.turn.duration_bucket\", hive=~\"$hive\", agent=~\"$agent\"}[$__rate_interval])))", + "expr": "histogram_quantile(0.95, sum by (le) (rate({__name__=\"hyperhive.agent.turn.duration_bucket\", agent=~\"$agent\"}[$__rate_interval])))", "legendFormat": "p95" } }, @@ -3037,7 +3005,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum(rate({__name__=\"hyperhive.agent.turn.duration_sum\", hive=~\"$hive\", agent=~\"$agent\"}[$__rate_interval])) / sum(rate({__name__=\"hyperhive.agent.turn.duration_count\", hive=~\"$hive\", agent=~\"$agent\"}[$__rate_interval]))", + "expr": "sum(rate({__name__=\"hyperhive.agent.turn.duration_sum\", agent=~\"$agent\"}[$__rate_interval])) / sum(rate({__name__=\"hyperhive.agent.turn.duration_count\", agent=~\"$agent\"}[$__rate_interval]))", "legendFormat": "mean" } }, @@ -3113,7 +3081,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sort_desc(sum by (wake_from) (increase({__name__=\"hyperhive.agent.turn.count\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])))", + "expr": "sort_desc(sum by (wake_from) (increase({__name__=\"hyperhive.agent.turn.count\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{wake_from}}" } @@ -3189,7 +3157,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sort_desc(sum by (result_kind) (increase({__name__=\"hyperhive.agent.turn.count\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])))", + "expr": "sort_desc(sum by (result_kind) (increase({__name__=\"hyperhive.agent.turn.count\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{result_kind}}" } @@ -3265,7 +3233,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (result_kind) (rate({__name__=\"hyperhive.agent.turn.count\", hive=~\"$hive\", agent=~\"$agent\", result_kind!=\"ok\"}[$__rate_interval])) * 3600", + "expr": "sum by (result_kind) (rate({__name__=\"hyperhive.agent.turn.count\", agent=~\"$agent\", result_kind!=\"ok\"}[$__rate_interval])) * 3600", "legendFormat": "{{result_kind}}" } }, @@ -3341,7 +3309,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sort_desc(topk(10, sum by (tool) (increase({__name__=\"hyperhive.agent.tool.calls\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))))", + "expr": "sort_desc(topk(10, sum by (tool) (increase({__name__=\"hyperhive.agent.tool.calls\", agent=~\"$agent\"}[$__range]))))", "instant": true, "legendFormat": "{{tool}}" } @@ -3417,7 +3385,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sort_desc(topk(10, sum by (command) (increase({__name__=\"hyperhive.agent.bash.commands\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))))", + "expr": "sort_desc(topk(10, sum by (command) (increase({__name__=\"hyperhive.agent.bash.commands\", agent=~\"$agent\"}[$__range]))))", "instant": true, "legendFormat": "{{command}}" } @@ -3493,7 +3461,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (event) (rate({__name__=\"hyperhive.agent.reminders\", hive=~\"$hive\", agent=~\"$agent\"}[$__rate_interval])) * 3600", + "expr": "sum by (event) (rate({__name__=\"hyperhive.agent.reminders\", agent=~\"$agent\"}[$__rate_interval])) * 3600", "legendFormat": "{{event}}" } }, @@ -3569,7 +3537,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "max by (agent) ({__name__=\"hyperhive.agent.first_turn.context\", hive=~\"$hive\", agent=~\"$agent\"})", + "expr": "max by (agent) ({__name__=\"hyperhive.agent.first_turn.context\", agent=~\"$agent\"})", "legendFormat": "{{agent}}" } }, @@ -3645,7 +3613,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sort_desc(sum by (agent) (increase({__name__=\"hyperhive.agent.session.count\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])))", + "expr": "sort_desc(sum by (agent) (increase({__name__=\"hyperhive.agent.session.count\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{agent}}" } @@ -3721,7 +3689,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "max by (agent) (last_over_time({__name__=\"hyperhive.agent.swarm_queue.connected\", hive=~\"$hive\", agent=~\"$agent\", agent!=\"\"}[5m])) or (max by (agent) (last_over_time({__name__=\"hyperhive.container.cpu.percent\", hive=~\"$hive\", agent=~\"$agent\", agent!=\"\"}[5m])) * 0 - 1)", + "expr": "max by (agent) (last_over_time({__name__=\"hyperhive.agent.swarm_queue.connected\", agent=~\"$agent\", agent!=\"\"}[5m])) or (max by (agent) (last_over_time({__name__=\"hyperhive.container.cpu.percent\", agent=~\"$agent\", agent!=\"\"}[5m])) * 0 - 1)", "legendFormat": "{{agent}}" } }, @@ -3823,7 +3791,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sum by (agent) (rate({__name__=\"hyperhive.agent.swarm_queue.publish_skipped\", hive=~\"$hive\", agent=~\"$agent\"}[$__rate_interval])) * 3600", + "expr": "sum by (agent) (rate({__name__=\"hyperhive.agent.swarm_queue.publish_skipped\", agent=~\"$agent\"}[$__rate_interval])) * 3600", "legendFormat": "{{agent}}" } }, @@ -3897,7 +3865,7 @@ "name": "@datasourceUid@" }, "spec": { - "expr": "sort_desc(sum by (agent) (increase({__name__=\"hyperhive.container.memory.oom_kills\", hive=~\"$hive\", agent=~\"$agent\", agent!=\"\"}[$__range])))", + "expr": "sort_desc(sum by (agent) (increase({__name__=\"hyperhive.container.memory.oom_kills\", agent=~\"$agent\", agent!=\"\"}[$__range])))", "instant": true, "legendFormat": "{{agent}}" } diff --git a/nix/host-modules/swarm-grafana/dashboards/archive.json b/nix/host-modules/swarm-grafana/dashboards/archive.json index a918d5f13..d7ef17aac 100644 --- a/nix/host-modules/swarm-grafana/dashboards/archive.json +++ b/nix/host-modules/swarm-grafana/dashboards/archive.json @@ -14,25 +14,6 @@ "version": 1, "templating": { "list": [ - { - "name": "hive", - "label": "Hive", - "type": "query", - "datasource": { - "type": "prometheus", - "uid": "@datasourceUid@" - }, - "query": "label_values({__name__=\"hyperhive.archive.backup.last_run_success\"}, hive)", - "refresh": 2, - "includeAll": true, - "allValue": ".*", - "multi": true, - "current": { - "text": "All", - "value": "$__all" - }, - "sort": 1 - }, { "name": "agent", "label": "Agent", @@ -41,7 +22,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "query": "label_values({__name__=\"hyperhive.archive.backup.last_run_success\", hive=~\"$hive\"}, agent)", + "query": "label_values({__name__=\"hyperhive.archive.backup.last_run_success\"}, agent)", "refresh": 2, "includeAll": true, "allValue": ".*", @@ -90,7 +71,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "count(time() - max by (agent) (last_over_time({__name__=\"hyperhive.archive.backup.last_success_timestamp_seconds\", hive=~\"$hive\", agent=~\"$agent\"}[7d])) > 7200) or vector(0)", + "expr": "count(time() - max by (agent) (last_over_time({__name__=\"hyperhive.archive.backup.last_success_timestamp_seconds\", agent=~\"$agent\"}[7d])) > 7200) or vector(0)", "instant": true } ], @@ -140,7 +121,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "count(max by (agent) (last_over_time({__name__=\"hyperhive.archive.backup.last_run_success\", hive=~\"$hive\", agent=~\"$agent\"}[7d])) == 0) or vector(0)", + "expr": "count(max by (agent) (last_over_time({__name__=\"hyperhive.archive.backup.last_run_success\", agent=~\"$agent\"}[7d])) == 0) or vector(0)", "instant": true } ], @@ -190,7 +171,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "count(max by (agent) (last_over_time({__name__=\"hyperhive.archive.backup.last_run_success\", hive=~\"$hive\", agent=~\"$agent\"}[7d]))) or vector(0)", + "expr": "count(max by (agent) (last_over_time({__name__=\"hyperhive.archive.backup.last_run_success\", agent=~\"$agent\"}[7d]))) or vector(0)", "instant": true } ], @@ -240,7 +221,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "time() - max by (agent) (last_over_time({__name__=\"hyperhive.archive.backup.last_success_timestamp_seconds\", hive=~\"$hive\", agent=~\"$agent\"}[7d]))", + "expr": "time() - max by (agent) (last_over_time({__name__=\"hyperhive.archive.backup.last_success_timestamp_seconds\", agent=~\"$agent\"}[7d]))", "instant": true, "format": "table" }, @@ -250,7 +231,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "max by (agent) (last_over_time({__name__=\"hyperhive.archive.backup.last_run_success\", hive=~\"$hive\", agent=~\"$agent\"}[7d]))", + "expr": "max by (agent) (last_over_time({__name__=\"hyperhive.archive.backup.last_run_success\", agent=~\"$agent\"}[7d]))", "instant": true, "format": "table" }, @@ -260,7 +241,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "max by (agent) (last_over_time({__name__=\"hyperhive.archive.backup.duration_seconds\", hive=~\"$hive\", agent=~\"$agent\"}[7d]))", + "expr": "max by (agent) (last_over_time({__name__=\"hyperhive.archive.backup.duration_seconds\", agent=~\"$agent\"}[7d]))", "instant": true, "format": "table" }, @@ -270,7 +251,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "max by (agent) (last_over_time({__name__=\"hyperhive.archive.backup.data_added_bytes\", hive=~\"$hive\", agent=~\"$agent\"}[7d]))", + "expr": "max by (agent) (last_over_time({__name__=\"hyperhive.archive.backup.data_added_bytes\", agent=~\"$agent\"}[7d]))", "instant": true, "format": "table" } @@ -439,7 +420,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "max by (agent) ({__name__=\"hyperhive.archive.backup.data_added_bytes\", hive=~\"$hive\", agent=~\"$agent\"})", + "expr": "max by (agent) ({__name__=\"hyperhive.archive.backup.data_added_bytes\", agent=~\"$agent\"})", "legendFormat": "{{agent}}" } ], @@ -495,7 +476,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "max by (agent) ({__name__=\"hyperhive.archive.backup.duration_seconds\", hive=~\"$hive\", agent=~\"$agent\"})", + "expr": "max by (agent) ({__name__=\"hyperhive.archive.backup.duration_seconds\", agent=~\"$agent\"})", "legendFormat": "{{agent}}" } ], diff --git a/nix/host-modules/swarm-grafana/dashboards/attic.json b/nix/host-modules/swarm-grafana/dashboards/attic.json index 7213f58b5..d24064d21 100644 --- a/nix/host-modules/swarm-grafana/dashboards/attic.json +++ b/nix/host-modules/swarm-grafana/dashboards/attic.json @@ -14,25 +14,6 @@ "version": 1, "templating": { "list": [ - { - "name": "hive", - "label": "Hive", - "type": "query", - "datasource": { - "type": "prometheus", - "uid": "@datasourceUid@" - }, - "query": "label_values({__name__=\"hyperhive.agent.closure_pullable\"}, hive)", - "refresh": 2, - "includeAll": true, - "allValue": ".*", - "multi": true, - "current": { - "text": "All", - "value": "$__all" - }, - "sort": 1 - }, { "name": "agent", "label": "Agent", @@ -41,7 +22,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "query": "label_values({__name__=\"hyperhive.agent.closure_pullable\", hive=~\"$hive\"}, agent)", + "query": "label_values({__name__=\"hyperhive.agent.closure_pullable\"}, agent)", "refresh": 2, "includeAll": true, "allValue": ".*", @@ -90,7 +71,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum(max by (hive, agent) (last_over_time({__name__=\"hyperhive.agent.closure_pullable\", hive=~\"$hive\", agent=~\"$agent\"}[3m]))) or vector(0)", + "expr": "sum(max by (agent) (last_over_time({__name__=\"hyperhive.agent.closure_pullable\", agent=~\"$agent\"}[3m]))) or vector(0)", "instant": true, "legendFormat": "pullable" } @@ -141,7 +122,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "count(max by (hive, agent) (last_over_time({__name__=\"hyperhive.agent.closure_pullable\", hive=~\"$hive\", agent=~\"$agent\"}[3m])) == 0) or vector(0)", + "expr": "count(max by (agent) (last_over_time({__name__=\"hyperhive.agent.closure_pullable\", agent=~\"$agent\"}[3m])) == 0) or vector(0)", "instant": true, "legendFormat": "not pullable" } @@ -294,7 +275,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "max by (agent, reason) (last_over_time({__name__=\"hyperhive.agent.closure_pullable\", hive=~\"$hive\", agent=~\"$agent\"}[3m]))", + "expr": "max by (agent, reason) (last_over_time({__name__=\"hyperhive.agent.closure_pullable\", agent=~\"$agent\"}[3m]))", "instant": true, "format": "table" } @@ -389,7 +370,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum(max by (hive, agent) ({__name__=\"hyperhive.agent.closure_pullable\", hive=~\"$hive\", agent=~\"$agent\"})) or vector(0)", + "expr": "sum(max by (agent) ({__name__=\"hyperhive.agent.closure_pullable\", agent=~\"$agent\"})) or vector(0)", "legendFormat": "pullable" }, { @@ -398,7 +379,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "count(max by (hive, agent) ({__name__=\"hyperhive.agent.closure_pullable\", hive=~\"$hive\", agent=~\"$agent\"}) == 0) or vector(0)", + "expr": "count(max by (agent) ({__name__=\"hyperhive.agent.closure_pullable\", agent=~\"$agent\"}) == 0) or vector(0)", "legendFormat": "not pullable" } ], diff --git a/nix/host-modules/swarm-grafana/dashboards/claude-usage.json b/nix/host-modules/swarm-grafana/dashboards/claude-usage.json index dc23b5709..264acd50e 100644 --- a/nix/host-modules/swarm-grafana/dashboards/claude-usage.json +++ b/nix/host-modules/swarm-grafana/dashboards/claude-usage.json @@ -14,25 +14,6 @@ }, "templating": { "list": [ - { - "name": "hive", - "label": "Hive", - "type": "query", - "datasource": { - "type": "prometheus", - "uid": "@datasourceUid@" - }, - "query": "label_values({__name__=\"claude_code.cost.usage\"}, hive)", - "refresh": 2, - "includeAll": true, - "allValue": ".*", - "multi": true, - "current": { - "text": "All", - "value": "$__all" - }, - "sort": 1 - }, { "name": "service", "label": "Service", @@ -55,7 +36,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "query": "label_values({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", \"service.name\"=~\"$service\"}, agent)", + "query": "label_values({__name__=\"claude_code.cost.usage\", \"service.name\"=~\"$service\"}, agent)", "refresh": 2, "includeAll": true, "allValue": ".*", @@ -91,7 +72,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum(increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range]))", + "expr": "sum(increase({__name__=\"claude_code.cost.usage\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range]))", "instant": true } ], @@ -139,7 +120,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum(increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range]))", + "expr": "sum(increase({__name__=\"claude_code.token.usage\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range]))", "instant": true } ], @@ -187,7 +168,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum(increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\", type=\"cacheRead\"}[$__range])) / sum(increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range]))", + "expr": "sum(increase({__name__=\"claude_code.token.usage\", \"service.name\"=~\"$service\", agent=~\"$agent\", type=\"cacheRead\"}[$__range])) / sum(increase({__name__=\"claude_code.token.usage\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range]))", "instant": true } ], @@ -235,7 +216,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum(increase({__name__=\"claude_code.active_time.total\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range]))", + "expr": "sum(increase({__name__=\"claude_code.active_time.total\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range]))", "instant": true } ], @@ -284,7 +265,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (type) (increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__interval])) / ($__interval_ms / 60000)", + "expr": "sum by (type) (increase({__name__=\"claude_code.token.usage\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__interval])) / ($__interval_ms / 60000)", "legendFormat": "{{type}}" } ], @@ -345,7 +326,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sort_desc(sum by (model) (increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])))", + "expr": "sort_desc(sum by (model) (increase({__name__=\"claude_code.token.usage\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{model}}" } @@ -405,7 +386,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (model) (increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__interval])) / ($__interval_ms / 60000)", + "expr": "sum by (model) (increase({__name__=\"claude_code.cost.usage\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__interval])) / ($__interval_ms / 60000)", "legendFormat": "{{model}}" } ], @@ -462,7 +443,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sort_desc(sum by (effort) (increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])))", + "expr": "sort_desc(sum by (effort) (increase({__name__=\"claude_code.cost.usage\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{effort}}" } @@ -521,7 +502,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sort_desc(sum by (query_source) (increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])))", + "expr": "sort_desc(sum by (query_source) (increase({__name__=\"claude_code.cost.usage\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{query_source}}" } @@ -580,7 +561,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sort_desc(sum by (language, decision) (increase({__name__=\"claude_code.code_edit_tool.decision\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])))", + "expr": "sort_desc(sum by (language, decision) (increase({__name__=\"claude_code.code_edit_tool.decision\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{language}} · {{decision}}" } @@ -639,7 +620,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sort_desc(sum by (tool_name, decision) (increase({__name__=\"claude_code.code_edit_tool.decision\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])))", + "expr": "sort_desc(sum by (tool_name, decision) (increase({__name__=\"claude_code.code_edit_tool.decision\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{tool_name}} · {{decision}}" } @@ -698,7 +679,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum(increase({__name__=\"claude_code.session.count\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range]))", + "expr": "sum(increase({__name__=\"claude_code.session.count\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range]))", "instant": true } ], @@ -746,7 +727,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum(increase({__name__=\"claude_code.active_time.total\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])) / sum(increase({__name__=\"claude_code.session.count\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range]))", + "expr": "sum(increase({__name__=\"claude_code.active_time.total\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])) / sum(increase({__name__=\"claude_code.session.count\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range]))", "instant": true } ], @@ -795,7 +776,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (agent) (increase({__name__=\"claude_code.session.count\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[1h]))", + "expr": "sum by (agent) (increase({__name__=\"claude_code.session.count\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[1h]))", "legendFormat": "{{agent}}" } ], @@ -852,7 +833,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.active_time.total\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])) / sum by (agent) (increase({__name__=\"claude_code.session.count\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])))", + "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.active_time.total\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])) / sum by (agent) (increase({__name__=\"claude_code.session.count\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{agent}}" } @@ -911,7 +892,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])))", + "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.cost.usage\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{agent}}" } @@ -970,7 +951,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])))", + "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.token.usage\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{agent}}" } @@ -1030,7 +1011,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "label_replace(max by (account, window) ({__name__=\"hyperhive.agent.claude_usage.percent\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"} unless on(agent, hive, window) ({__name__=\"hyperhive.agent.claude_usage.resets_at\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"} < time())), \"account\", \"unlabelled\", \"account\", \"\")", + "expr": "label_replace(max by (account, window) ({__name__=\"hyperhive.agent.claude_usage.percent\", \"service.name\"=~\"$service\", agent=~\"$agent\"} unless on(agent, window) ({__name__=\"hyperhive.agent.claude_usage.resets_at\", \"service.name\"=~\"$service\", agent=~\"$agent\"} < time())), \"account\", \"unlabelled\", \"account\", \"\")", "legendFormat": "{{account}} · {{window}} used" }, { @@ -1039,7 +1020,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "label_replace((100 * (1 - (max by (account, window) ({__name__=\"hyperhive.agent.claude_usage.resets_at\", window=\"seven_day\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}) - time()) / 604800)) < 100 or (100 * (1 - (max by (account, window) ({__name__=\"hyperhive.agent.claude_usage.resets_at\", window=\"five_hour\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}) - time()) / 18000)) < 100, \"account\", \"unlabelled\", \"account\", \"\")", + "expr": "label_replace((100 * (1 - (max by (account, window) ({__name__=\"hyperhive.agent.claude_usage.resets_at\", window=\"seven_day\", \"service.name\"=~\"$service\", agent=~\"$agent\"}) - time()) / 604800)) < 100 or (100 * (1 - (max by (account, window) ({__name__=\"hyperhive.agent.claude_usage.resets_at\", window=\"five_hour\", \"service.name\"=~\"$service\", agent=~\"$agent\"}) - time()) / 18000)) < 100, \"account\", \"unlabelled\", \"account\", \"\")", "legendFormat": "{{account}} · {{window}} elapsed" } ], diff --git a/nix/host-modules/swarm-grafana/dashboards/gateway.json b/nix/host-modules/swarm-grafana/dashboards/gateway.json index 1a9ee6a53..a5235b3d1 100644 --- a/nix/host-modules/swarm-grafana/dashboards/gateway.json +++ b/nix/host-modules/swarm-grafana/dashboards/gateway.json @@ -15,14 +15,14 @@ "templating": { "list": [ { - "name": "hive", - "label": "Hive", + "name": "host", + "label": "Host", "type": "query", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, - "query": "label_values({__name__=\"nginx.requests\"}, hive)", + "query": "label_values({__name__=\"nginx.requests\"}, \"host.name\")", "refresh": 2, "includeAll": true, "allValue": ".*", @@ -58,7 +58,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum(rate({__name__=\"nginx.requests\", hive=~\"$hive\"}[$__rate_interval])) or vector(0)", + "expr": "sum(rate({__name__=\"nginx.requests\", \"host.name\"=~\"$host\"}[$__rate_interval])) or vector(0)", "instant": true } ], @@ -116,7 +116,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum({__name__=\"nginx.connections_current\", hive=~\"$hive\", state=\"active\"}) or vector(0)", + "expr": "sum({__name__=\"nginx.connections_current\", \"host.name\"=~\"$host\", state=\"active\"}) or vector(0)", "instant": true } ], @@ -174,7 +174,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "(sum(increase({__name__=\"nginx.connections_accepted\", hive=~\"$hive\"}[$__range])) - sum(increase({__name__=\"nginx.connections_handled\", hive=~\"$hive\"}[$__range]))) or vector(0)", + "expr": "(sum(increase({__name__=\"nginx.connections_accepted\", \"host.name\"=~\"$host\"}[$__range])) - sum(increase({__name__=\"nginx.connections_handled\", \"host.name\"=~\"$host\"}[$__range]))) or vector(0)", "instant": true } ], @@ -232,8 +232,8 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (hive) (rate({__name__=\"nginx.requests\", hive=~\"$hive\"}[$__rate_interval]))", - "legendFormat": "{{hive}}" + "expr": "sum by (\"host.name\") (rate({__name__=\"nginx.requests\", \"host.name\"=~\"$host\"}[$__rate_interval]))", + "legendFormat": "{{host.name}}" } ], "fieldConfig": { @@ -288,8 +288,8 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (hive, state) ({__name__=\"nginx.connections_current\", hive=~\"$hive\"})", - "legendFormat": "{{hive}} {{state}}" + "expr": "sum by (\"host.name\", state) ({__name__=\"nginx.connections_current\", \"host.name\"=~\"$host\"})", + "legendFormat": "{{host.name}} {{state}}" } ], "fieldConfig": { @@ -344,8 +344,8 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (hive) (rate({__name__=\"nginx.connections_accepted\", hive=~\"$hive\"}[$__rate_interval]))", - "legendFormat": "{{hive}} accepted" + "expr": "sum by (\"host.name\") (rate({__name__=\"nginx.connections_accepted\", \"host.name\"=~\"$host\"}[$__rate_interval]))", + "legendFormat": "{{host.name}} accepted" }, { "refId": "B", @@ -353,8 +353,8 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (hive) (rate({__name__=\"nginx.connections_handled\", hive=~\"$hive\"}[$__rate_interval]))", - "legendFormat": "{{hive}} handled" + "expr": "sum by (\"host.name\") (rate({__name__=\"nginx.connections_handled\", \"host.name\"=~\"$host\"}[$__rate_interval]))", + "legendFormat": "{{host.name}} handled" } ], "fieldConfig": { diff --git a/nix/host-modules/swarm-grafana/dashboards/host.json b/nix/host-modules/swarm-grafana/dashboards/host.json index f63dfc3c2..5bef503da 100644 --- a/nix/host-modules/swarm-grafana/dashboards/host.json +++ b/nix/host-modules/swarm-grafana/dashboards/host.json @@ -14,25 +14,6 @@ }, "templating": { "list": [ - { - "name": "hive", - "label": "Hive", - "type": "query", - "datasource": { - "type": "prometheus", - "uid": "@datasourceUid@" - }, - "query": "label_values({__name__=\"system.memory.usage\"}, hive)", - "refresh": 2, - "includeAll": true, - "allValue": ".*", - "multi": true, - "current": { - "text": "All", - "value": "$__all" - }, - "sort": 1 - }, { "name": "host", "label": "Host", @@ -41,7 +22,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "query": "label_values({__name__=\"system.memory.usage\", hive=~\"$hive\"}, \"host.name\")", + "query": "label_values({__name__=\"system.memory.usage\"}, \"host.name\")", "refresh": 2, "includeAll": true, "allValue": ".*", @@ -77,7 +58,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (state) (rate({__name__=\"system.cpu.time\", hive=~\"$hive\", \"host.name\"=~\"$host\"}[5m])) / scalar(sum(rate({__name__=\"system.cpu.time\", hive=~\"$hive\", \"host.name\"=~\"$host\"}[5m])))", + "expr": "sum by (state) (rate({__name__=\"system.cpu.time\", \"host.name\"=~\"$host\"}[5m])) / scalar(sum(rate({__name__=\"system.cpu.time\", \"host.name\"=~\"$host\"}[5m])))", "legendFormat": "{{state}}" } ], @@ -138,7 +119,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "max by (\"host.name\") ({__name__=\"system.cpu.load_average.1m\", hive=~\"$hive\", \"host.name\"=~\"$host\"})", + "expr": "max by (\"host.name\") ({__name__=\"system.cpu.load_average.1m\", \"host.name\"=~\"$host\"})", "legendFormat": "{{host.name}} 1m" }, { @@ -147,7 +128,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "max by (\"host.name\") ({__name__=\"system.cpu.load_average.5m\", hive=~\"$hive\", \"host.name\"=~\"$host\"})", + "expr": "max by (\"host.name\") ({__name__=\"system.cpu.load_average.5m\", \"host.name\"=~\"$host\"})", "legendFormat": "{{host.name}} 5m" }, { @@ -156,7 +137,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "max by (\"host.name\") ({__name__=\"system.cpu.load_average.15m\", hive=~\"$hive\", \"host.name\"=~\"$host\"})", + "expr": "max by (\"host.name\") ({__name__=\"system.cpu.load_average.15m\", \"host.name\"=~\"$host\"})", "legendFormat": "{{host.name}} 15m" } ], @@ -212,7 +193,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (state) ({__name__=\"system.memory.usage\", hive=~\"$hive\", \"host.name\"=~\"$host\", state=~\"used|cached|free\"})", + "expr": "sum by (state) ({__name__=\"system.memory.usage\", \"host.name\"=~\"$host\", state=~\"used|cached|free\"})", "legendFormat": "{{state}}" } ], @@ -272,7 +253,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (device) ({__name__=\"system.paging.usage\", hive=~\"$hive\", \"host.name\"=~\"$host\", state=\"used\"})", + "expr": "sum by (device) ({__name__=\"system.paging.usage\", \"host.name\"=~\"$host\", state=\"used\"})", "legendFormat": "{{device}}" } ], @@ -328,7 +309,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (direction, type) (rate({__name__=\"system.paging.operations\", hive=~\"$hive\", \"host.name\"=~\"$host\"}[5m]))", + "expr": "sum by (direction, type) (rate({__name__=\"system.paging.operations\", \"host.name\"=~\"$host\"}[5m]))", "legendFormat": "{{direction}} {{type}}" } ], @@ -384,7 +365,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (device, direction) (rate({__name__=\"system.disk.io\", hive=~\"$hive\", \"host.name\"=~\"$host\"}[5m]))", + "expr": "sum by (device, direction) (rate({__name__=\"system.disk.io\", \"host.name\"=~\"$host\"}[5m]))", "legendFormat": "{{device}} {{direction}}" } ], @@ -440,7 +421,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (device, direction) (rate({__name__=\"system.disk.operations\", hive=~\"$hive\", \"host.name\"=~\"$host\"}[5m]))", + "expr": "sum by (device, direction) (rate({__name__=\"system.disk.operations\", \"host.name\"=~\"$host\"}[5m]))", "legendFormat": "{{device}} {{direction}}" } ], @@ -496,7 +477,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (device, direction) (rate({__name__=\"system.network.io\", hive=~\"$hive\", \"host.name\"=~\"$host\"}[5m]))", + "expr": "sum by (device, direction) (rate({__name__=\"system.network.io\", \"host.name\"=~\"$host\"}[5m]))", "legendFormat": "{{device}} {{direction}}" } ], @@ -552,7 +533,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (device, direction) (rate({__name__=\"system.network.errors\", hive=~\"$hive\", \"host.name\"=~\"$host\"}[5m]))", + "expr": "sum by (device, direction) (rate({__name__=\"system.network.errors\", \"host.name\"=~\"$host\"}[5m]))", "legendFormat": "{{device}} {{direction}}" } ], @@ -608,7 +589,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (mountpoint) ({__name__=\"system.filesystem.usage\", hive=~\"$hive\", \"host.name\"=~\"$host\", state=\"used\"}) / sum by (mountpoint) ({__name__=\"system.filesystem.usage\", hive=~\"$hive\", \"host.name\"=~\"$host\", state=~\"used|free\"})", + "expr": "sum by (mountpoint) ({__name__=\"system.filesystem.usage\", \"host.name\"=~\"$host\", state=\"used\"}) / sum by (mountpoint) ({__name__=\"system.filesystem.usage\", \"host.name\"=~\"$host\", state=~\"used|free\"})", "legendFormat": "{{mountpoint}}" } ], @@ -665,7 +646,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "max by (\"host.name\") ({__name__=\"hyperhive.hive.nix_store.utilization\", hive=~\"$hive\", \"host.name\"=~\"$host\"})", + "expr": "max by (\"host.name\") ({__name__=\"hyperhive.hive.nix_store.utilization\", \"host.name\"=~\"$host\"})", "legendFormat": "{{host.name}}", "instant": true } @@ -733,7 +714,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "max by (\"host.name\") ({__name__=\"system.uptime\", hive=~\"$hive\", \"host.name\"=~\"$host\"})", + "expr": "max by (\"host.name\") ({__name__=\"system.uptime\", \"host.name\"=~\"$host\"})", "legendFormat": "{{host.name}}", "instant": true } @@ -791,7 +772,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (\"host.name\") ({__name__=\"system.processes.count\", hive=~\"$hive\", \"host.name\"=~\"$host\"})", + "expr": "sum by (\"host.name\") ({__name__=\"system.processes.count\", \"host.name\"=~\"$host\"})", "legendFormat": "{{host.name}}", "instant": true } @@ -849,7 +830,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (status) ({__name__=\"system.processes.count\", hive=~\"$hive\", \"host.name\"=~\"$host\"})", + "expr": "sum by (status) ({__name__=\"system.processes.count\", \"host.name\"=~\"$host\"})", "legendFormat": "{{status}}" } ], @@ -909,7 +890,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "topk(10, sum by (\"container.name\") ({__name__=\"container.memory.usage\", hive=~\"$hive\", \"host.name\"=~\"$host\"}))", + "expr": "topk(10, sum by (\"container.name\") ({__name__=\"container.memory.usage\", \"host.name\"=~\"$host\"}))", "legendFormat": "{{container.name}}" } ], @@ -965,7 +946,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "topk(10, sum by (\"container.name\") (rate({__name__=\"container.cpu.time\", hive=~\"$hive\", \"host.name\"=~\"$host\"}[5m])))", + "expr": "topk(10, sum by (\"container.name\") (rate({__name__=\"container.cpu.time\", \"host.name\"=~\"$host\"}[5m])))", "legendFormat": "{{container.name}}" } ], @@ -1021,7 +1002,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "avg by (resource) (rate({__name__=\"hyperhive.hive.pressure.stall\", kind=\"some\", hive=~\"$hive\", \"host.name\"=~\"$host\"}[5m])) / 1000000", + "expr": "avg by (resource) (rate({__name__=\"hyperhive.hive.pressure.stall\", kind=\"some\", \"host.name\"=~\"$host\"}[5m])) / 1000000", "legendFormat": "{{resource}}" } ], @@ -1077,7 +1058,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "avg by (resource) (rate({__name__=\"hyperhive.hive.pressure.stall\", kind=\"full\", resource!=\"cpu\", hive=~\"$hive\", \"host.name\"=~\"$host\"}[5m])) / 1000000", + "expr": "avg by (resource) (rate({__name__=\"hyperhive.hive.pressure.stall\", kind=\"full\", resource!=\"cpu\", \"host.name\"=~\"$host\"}[5m])) / 1000000", "legendFormat": "{{resource}}" } ], @@ -1133,7 +1114,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "topk(10, sum by (\"container.name\") (rate({__name__=\"hyperhive.container.memory.pressure.stall\", kind=\"some\", hive=~\"$hive\", \"host.name\"=~\"$host\"}[5m])) / 1000000)", + "expr": "topk(10, sum by (\"container.name\") (rate({__name__=\"hyperhive.container.memory.pressure.stall\", kind=\"some\", \"host.name\"=~\"$host\"}[5m])) / 1000000)", "legendFormat": "{{container.name}}" } ],