# Recording rules over AgentHub's /api/metrics series (docs/MONITORING.md). # The agenthub:cost_usd:* rules need agenthub_cost_usd_total{tool,model}; on a # dashboard that does not export it they simply record nothing. groups: - name: agenthub_recording interval: 30s rules: - record: agenthub:sessions:total expr: sum(agenthub_sessions) - record: agenthub:sessions:active expr: sum(agenthub_sessions{status="active"}) - record: agenthub:agents:working expr: sum(agenthub_agents{status="working"}) - record: agenthub:agents:waiting expr: sum(agenthub_agents{status="waiting"}) - record: agenthub:events:rate5m expr: sum(rate(agenthub_events_total[5m])) - record: agenthub:tokens:rate5m expr: sum by (kind) (rate(agenthub_tokens_total[5m])) - record: agenthub:tokens:total expr: sum(agenthub_tokens_total) - record: agenthub:cost_usd:total expr: sum(agenthub_cost_usd_total) - record: agenthub:cost_usd:increase1h expr: sum by (tool) (increase(agenthub_cost_usd_total[1h])) - record: agenthub:cost_usd:increase24h expr: sum by (tool, model) (increase(agenthub_cost_usd_total[24h]))