{ "uid": "agenthub-tokens-cost", "title": "AgentHub — Tokens & cost", "description": "Token usage by kind and estimated USD spend by tool and model.", "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": "Tokens (all time)", "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_tokens_total)", "legendFormat": "__auto", "instant": true, "range": false } ], "fieldConfig": { "defaults": { "unit": "short" }, "overrides": [] }, "options": { "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "colorMode": "value", "graphMode": "area", "textMode": "auto" } }, { "id": 2, "type": "stat", "title": "Cache read share (24h)", "datasource": { "type": "prometheus", "uid": "${ds}" }, "gridPos": { "x": 6, "y": 0, "w": 6, "h": 4 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${ds}" }, "expr": "sum(increase(agenthub_tokens_total{kind=\"cache_read\"}[24h])) / sum(increase(agenthub_tokens_total{kind=~\"input|cache_read|cache_write\"}[24h]))", "legendFormat": "__auto", "instant": true, "range": false } ], "fieldConfig": { "defaults": { "unit": "percentunit", "decimals": 1 }, "overrides": [] }, "options": { "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "colorMode": "value", "graphMode": "area", "textMode": "auto" } }, { "id": 3, "type": "stat", "title": "Spend (all time)", "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_cost_usd_total)", "legendFormat": "__auto", "instant": true, "range": false } ], "fieldConfig": { "defaults": { "unit": "currencyUSD", "decimals": 2 }, "overrides": [] }, "options": { "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "colorMode": "value", "graphMode": "area", "textMode": "auto" }, "description": "Requires agenthub_cost_usd_total{tool,model} — empty on a dashboard that does not export it yet." }, { "id": 4, "type": "stat", "title": "Spend (24h)", "datasource": { "type": "prometheus", "uid": "${ds}" }, "gridPos": { "x": 18, "y": 0, "w": 6, "h": 4 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${ds}" }, "expr": "sum(increase(agenthub_cost_usd_total[24h]))", "legendFormat": "__auto", "instant": true, "range": false } ], "fieldConfig": { "defaults": { "unit": "currencyUSD", "decimals": 2 }, "overrides": [] }, "options": { "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "colorMode": "value", "graphMode": "area", "textMode": "auto" }, "description": "Requires agenthub_cost_usd_total{tool,model} — empty on a dashboard that does not export it yet." }, { "id": 5, "type": "timeseries", "title": "Tokens per hour, by kind", "datasource": { "type": "prometheus", "uid": "${ds}" }, "gridPos": { "x": 0, "y": 4, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${ds}" }, "expr": "sum by (kind) (increase(agenthub_tokens_total[1h]))", "legendFormat": "{{kind}}" } ], "fieldConfig": { "defaults": { "unit": "short", "custom": { "drawStyle": "bars", "fillOpacity": 60, "stacking": { "mode": "normal" } } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "interval": "1h" }, { "id": 6, "type": "timeseries", "title": "Token burn (per second, by kind)", "datasource": { "type": "prometheus", "uid": "${ds}" }, "gridPos": { "x": 12, "y": 4, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${ds}" }, "expr": "sum by (kind) (rate(agenthub_tokens_total[5m]))", "legendFormat": "{{kind}}" } ], "fieldConfig": { "defaults": { "unit": "short", "custom": { "fillOpacity": 15, "lineWidth": 2, "stacking": { "mode": "normal" } } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } } }, { "id": 7, "type": "timeseries", "title": "Spend per hour, by tool", "datasource": { "type": "prometheus", "uid": "${ds}" }, "gridPos": { "x": 0, "y": 12, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${ds}" }, "expr": "sum by (tool) (increase(agenthub_cost_usd_total[1h]))", "legendFormat": "{{tool}}" } ], "fieldConfig": { "defaults": { "unit": "currencyUSD", "custom": { "drawStyle": "bars", "fillOpacity": 60, "stacking": { "mode": "normal" } } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom" }, "tooltip": { "mode": "multi" } }, "interval": "1h", "description": "Requires agenthub_cost_usd_total{tool,model} — empty on a dashboard that does not export it yet." }, { "id": 8, "type": "piechart", "title": "Spend by tool (all time)", "datasource": { "type": "prometheus", "uid": "${ds}" }, "gridPos": { "x": 12, "y": 12, "w": 12, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${ds}" }, "expr": "sum by (tool) (agenthub_cost_usd_total)", "legendFormat": "{{tool}}", "instant": true, "range": false } ], "fieldConfig": { "defaults": { "unit": "currencyUSD", "decimals": 2 }, "overrides": [] }, "description": "Requires agenthub_cost_usd_total{tool,model} — empty on a dashboard that does not export it yet.", "options": { "pieType": "donut", "legend": { "displayMode": "table", "placement": "right", "values": ["value", "percent"] }, "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } } }, { "id": 9, "type": "bargauge", "title": "Top models by spend (24h)", "datasource": { "type": "prometheus", "uid": "${ds}" }, "gridPos": { "x": 0, "y": 20, "w": 24, "h": 8 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "${ds}" }, "expr": "topk(10, sum by (model) (increase(agenthub_cost_usd_total[24h])))", "legendFormat": "{{model}}", "instant": true, "range": false } ], "fieldConfig": { "defaults": { "unit": "currencyUSD", "decimals": 2 }, "overrides": [] }, "description": "Requires agenthub_cost_usd_total{tool,model} — empty on a dashboard that does not export it yet.", "options": { "orientation": "horizontal", "displayMode": "gradient", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } } } ] }