Created
December 11, 2025 06:13
-
-
Save mikelane/f6c3a175cd9f92410aba06b5ac24ba54 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "apiVersion": "dashboard.grafana.app/v2beta1", | |
| "kind": "Dashboard", | |
| "metadata": { | |
| "name": "claude-code-metrics", | |
| "generation": 12, | |
| "creationTimestamp": "2025-12-10T13:33:56Z", | |
| "labels": {}, | |
| "annotations": {} | |
| }, | |
| "spec": { | |
| "annotations": [ | |
| { | |
| "kind": "AnnotationQuery", | |
| "spec": { | |
| "builtIn": true, | |
| "enable": true, | |
| "hide": true, | |
| "iconColor": "rgba(0, 211, 255, 1)", | |
| "name": "Annotations & Alerts", | |
| "query": { | |
| "group": "grafana", | |
| "kind": "DataQuery", | |
| "spec": {}, | |
| "version": "v0" | |
| } | |
| } | |
| } | |
| ], | |
| "cursorSync": "Off", | |
| "editable": true, | |
| "elements": { | |
| "panel-1": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "count(count by (session_id)(claude_code_token_usage_tokens_total))" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "Total Claude Code sessions tracked", | |
| "id": 1, | |
| "links": [], | |
| "title": "Sessions", | |
| "vizConfig": { | |
| "group": "stat", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "green", | |
| "value": 0 | |
| } | |
| ] | |
| }, | |
| "unit": "none" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "colorMode": "value", | |
| "graphMode": "none", | |
| "justifyMode": "center", | |
| "orientation": "auto", | |
| "percentChangeColorMode": "standard", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "showPercentChange": false, | |
| "textMode": "auto", | |
| "wideLayout": true | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-10": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum(claude_code_token_usage_tokens_total{type=\"input\"})" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "Tokens sent to Claude", | |
| "id": 10, | |
| "links": [], | |
| "title": "Input Tokens", | |
| "vizConfig": { | |
| "group": "stat", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "light-blue", | |
| "value": 0 | |
| } | |
| ] | |
| }, | |
| "unit": "short" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "colorMode": "value", | |
| "graphMode": "area", | |
| "justifyMode": "center", | |
| "orientation": "auto", | |
| "percentChangeColorMode": "standard", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "showPercentChange": false, | |
| "textMode": "auto", | |
| "wideLayout": true | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-11": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum(claude_code_token_usage_tokens_total{type=\"output\"})" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "Tokens generated by Claude", | |
| "id": 11, | |
| "links": [], | |
| "title": "Output Tokens", | |
| "vizConfig": { | |
| "group": "stat", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "light-orange", | |
| "value": 0 | |
| } | |
| ] | |
| }, | |
| "unit": "short" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "colorMode": "value", | |
| "graphMode": "area", | |
| "justifyMode": "center", | |
| "orientation": "auto", | |
| "percentChangeColorMode": "standard", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "showPercentChange": false, | |
| "textMode": "auto", | |
| "wideLayout": true | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-12": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum(claude_code_token_usage_tokens_total{type=\"cacheRead\"})" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "Tokens read from cache (saves money!)", | |
| "id": 12, | |
| "links": [], | |
| "title": "Cache Read", | |
| "vizConfig": { | |
| "group": "stat", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "semi-dark-green", | |
| "value": 0 | |
| } | |
| ] | |
| }, | |
| "unit": "short" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "colorMode": "value", | |
| "graphMode": "area", | |
| "justifyMode": "center", | |
| "orientation": "auto", | |
| "percentChangeColorMode": "standard", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "showPercentChange": false, | |
| "textMode": "auto", | |
| "wideLayout": true | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-13": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum(claude_code_token_usage_tokens_total{type=\"cacheCreation\"})" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "Tokens written to cache", | |
| "id": 13, | |
| "links": [], | |
| "title": "Cache Creation", | |
| "vizConfig": { | |
| "group": "stat", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "light-purple", | |
| "value": 0 | |
| } | |
| ] | |
| }, | |
| "unit": "short" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "colorMode": "value", | |
| "graphMode": "area", | |
| "justifyMode": "center", | |
| "orientation": "auto", | |
| "percentChangeColorMode": "standard", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "showPercentChange": false, | |
| "textMode": "auto", | |
| "wideLayout": true | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-14": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum(claude_code_token_usage_tokens_total{type=\"cacheRead\"}) / (sum(claude_code_token_usage_tokens_total{type=\"cacheRead\"}) + sum(claude_code_token_usage_tokens_total{type=\"input\"})) * 100" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "Percentage of input served from cache", | |
| "id": 14, | |
| "links": [], | |
| "title": "Cache Efficiency", | |
| "vizConfig": { | |
| "group": "gauge", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "max": 100, | |
| "min": 0, | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "red", | |
| "value": 0 | |
| }, | |
| { | |
| "color": "yellow", | |
| "value": 50 | |
| }, | |
| { | |
| "color": "green", | |
| "value": 80 | |
| } | |
| ] | |
| }, | |
| "unit": "percent" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "minVizHeight": 75, | |
| "minVizWidth": 75, | |
| "orientation": "auto", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "showThresholdLabels": false, | |
| "showThresholdMarkers": true, | |
| "sizing": "auto" | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-15": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum(claude_code_cost_usage_USD_total) / sum(claude_code_token_usage_tokens_total{type=\"output\"}) * 1000" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "Average cost per 1000 output tokens", | |
| "id": 15, | |
| "links": [], | |
| "title": "Cost per 1K Output", | |
| "vizConfig": { | |
| "group": "stat", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "decimals": 4, | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "green", | |
| "value": 0 | |
| }, | |
| { | |
| "color": "yellow", | |
| "value": 0.05 | |
| }, | |
| { | |
| "color": "red", | |
| "value": 0.1 | |
| } | |
| ] | |
| }, | |
| "unit": "currencyUSD" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "colorMode": "value", | |
| "graphMode": "none", | |
| "justifyMode": "center", | |
| "orientation": "auto", | |
| "percentChangeColorMode": "standard", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "showPercentChange": false, | |
| "textMode": "auto", | |
| "wideLayout": true | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-2": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum(claude_code_commit_count_total)" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "Total commits made via Claude Code", | |
| "id": 2, | |
| "links": [], | |
| "title": "Commits Made", | |
| "vizConfig": { | |
| "group": "stat", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "blue", | |
| "value": 0 | |
| } | |
| ] | |
| }, | |
| "unit": "none" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "colorMode": "value", | |
| "graphMode": "none", | |
| "justifyMode": "center", | |
| "orientation": "auto", | |
| "percentChangeColorMode": "standard", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "showPercentChange": false, | |
| "textMode": "auto", | |
| "wideLayout": true | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-20": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum by (type) (claude_code_token_usage_tokens_total)", | |
| "legendFormat": "{{type}}" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "Distribution of token usage by type", | |
| "id": 20, | |
| "links": [], | |
| "title": "Tokens by Type", | |
| "vizConfig": { | |
| "group": "piechart", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "color": { | |
| "mode": "palette-classic" | |
| }, | |
| "custom": { | |
| "hideFrom": { | |
| "legend": false, | |
| "tooltip": false, | |
| "viz": false | |
| } | |
| } | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "legend": { | |
| "displayMode": "table", | |
| "placement": "right", | |
| "showLegend": true, | |
| "values": [ | |
| "value", | |
| "percent" | |
| ] | |
| }, | |
| "pieType": "donut", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "sort": "desc", | |
| "tooltip": { | |
| "hideZeros": false, | |
| "mode": "single", | |
| "sort": "none" | |
| } | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-21": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum by (model) (claude_code_token_usage_tokens_total)", | |
| "legendFormat": "{{model}}" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "Token usage broken down by model", | |
| "id": 21, | |
| "links": [], | |
| "title": "Tokens by Model", | |
| "vizConfig": { | |
| "group": "piechart", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "color": { | |
| "mode": "palette-classic" | |
| }, | |
| "custom": { | |
| "hideFrom": { | |
| "legend": false, | |
| "tooltip": false, | |
| "viz": false | |
| } | |
| } | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "legend": { | |
| "displayMode": "table", | |
| "placement": "right", | |
| "showLegend": true, | |
| "values": [ | |
| "value", | |
| "percent" | |
| ] | |
| }, | |
| "pieType": "donut", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "sort": "desc", | |
| "tooltip": { | |
| "hideZeros": false, | |
| "mode": "single", | |
| "sort": "none" | |
| } | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-22": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum by (model) (claude_code_cost_usage_USD_total)", | |
| "legendFormat": "{{model}}" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "API cost broken down by model", | |
| "id": 22, | |
| "links": [], | |
| "title": "Cost by Model", | |
| "vizConfig": { | |
| "group": "bargauge", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "color": { | |
| "mode": "thresholds" | |
| }, | |
| "decimals": 2, | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "green", | |
| "value": 0 | |
| }, | |
| { | |
| "color": "yellow", | |
| "value": 5 | |
| }, | |
| { | |
| "color": "red", | |
| "value": 20 | |
| } | |
| ] | |
| }, | |
| "unit": "currencyUSD" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "displayMode": "gradient", | |
| "legend": { | |
| "calcs": [], | |
| "displayMode": "list", | |
| "placement": "bottom", | |
| "showLegend": false | |
| }, | |
| "maxVizHeight": 300, | |
| "minVizHeight": 16, | |
| "minVizWidth": 8, | |
| "namePlacement": "auto", | |
| "orientation": "horizontal", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "showUnfilled": true, | |
| "sizing": "auto", | |
| "valueMode": "color" | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-3": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum(claude_code_active_time_seconds_total{type=\"cli\"})" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "Time Claude spent actively working", | |
| "id": 3, | |
| "links": [], | |
| "title": "Active Time (CLI)", | |
| "vizConfig": { | |
| "group": "stat", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "purple", | |
| "value": 0 | |
| } | |
| ] | |
| }, | |
| "unit": "s" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "colorMode": "value", | |
| "graphMode": "none", | |
| "justifyMode": "center", | |
| "orientation": "auto", | |
| "percentChangeColorMode": "standard", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "showPercentChange": false, | |
| "textMode": "auto", | |
| "wideLayout": true | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-30": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum by (type) (claude_code_active_time_seconds_total)", | |
| "legendFormat": "{{type}}" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "CLI processing time vs User interaction time", | |
| "id": 30, | |
| "links": [], | |
| "title": "Active Time Distribution", | |
| "vizConfig": { | |
| "group": "piechart", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "color": { | |
| "mode": "palette-classic" | |
| }, | |
| "custom": { | |
| "hideFrom": { | |
| "legend": false, | |
| "tooltip": false, | |
| "viz": false | |
| } | |
| }, | |
| "unit": "s" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "legend": { | |
| "displayMode": "table", | |
| "placement": "right", | |
| "showLegend": true, | |
| "values": [ | |
| "value", | |
| "percent" | |
| ] | |
| }, | |
| "pieType": "donut", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "sort": "desc", | |
| "tooltip": { | |
| "hideZeros": false, | |
| "mode": "single", | |
| "sort": "none" | |
| } | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-31": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum(claude_code_active_time_seconds_total{type=\"cli\"}) / sum(claude_code_active_time_seconds_total{type=\"user\"})" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "CLI time / User time - higher = Claude doing more work", | |
| "id": 31, | |
| "links": [], | |
| "title": "Productivity Ratio", | |
| "vizConfig": { | |
| "group": "gauge", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "decimals": 0, | |
| "max": 1000, | |
| "min": 0, | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "red", | |
| "value": 0 | |
| }, | |
| { | |
| "color": "yellow", | |
| "value": 50 | |
| }, | |
| { | |
| "color": "green", | |
| "value": 200 | |
| }, | |
| { | |
| "color": "super-light-green", | |
| "value": 500 | |
| } | |
| ] | |
| }, | |
| "unit": "x" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "minVizHeight": 75, | |
| "minVizWidth": 75, | |
| "orientation": "auto", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "showThresholdLabels": true, | |
| "showThresholdMarkers": true, | |
| "sizing": "auto" | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-36": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "max_over_time((sum(claude_code_active_time_seconds_total{type=\"cli\"}) / sum(claude_code_active_time_seconds_total{type=\"user\"}))[$__range:])", | |
| "legendFormat": "Peak" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "Highest productivity ratio in time window", | |
| "id": 36, | |
| "links": [], | |
| "title": "Peak Leverage", | |
| "vizConfig": { | |
| "group": "stat", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "decimals": 0, | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "super-light-green", | |
| "value": 0 | |
| } | |
| ] | |
| }, | |
| "unit": "x" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "colorMode": "value", | |
| "graphMode": "none", | |
| "justifyMode": "center", | |
| "orientation": "auto", | |
| "percentChangeColorMode": "standard", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "max" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "showPercentChange": false, | |
| "textMode": "value_and_name", | |
| "wideLayout": true | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-4": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum(claude_code_active_time_seconds_total{type=\"user\"})" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "Time you spent interacting with Claude", | |
| "id": 4, | |
| "links": [], | |
| "title": "Active Time (You)", | |
| "vizConfig": { | |
| "group": "stat", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "orange", | |
| "value": 0 | |
| } | |
| ] | |
| }, | |
| "unit": "s" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "colorMode": "value", | |
| "graphMode": "none", | |
| "justifyMode": "center", | |
| "orientation": "auto", | |
| "percentChangeColorMode": "standard", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "showPercentChange": false, | |
| "textMode": "auto", | |
| "wideLayout": true | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-40": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum by (type) (rate(claude_code_token_usage_tokens_total[5m]))", | |
| "legendFormat": "{{type}}" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "Token consumption rate by type", | |
| "id": 40, | |
| "links": [], | |
| "title": "Token Usage Over Time", | |
| "vizConfig": { | |
| "group": "timeseries", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "color": { | |
| "mode": "palette-classic" | |
| }, | |
| "custom": { | |
| "axisBorderShow": false, | |
| "axisCenteredZero": false, | |
| "axisColorMode": "text", | |
| "axisLabel": "tokens/sec", | |
| "axisPlacement": "auto", | |
| "barAlignment": 0, | |
| "barWidthFactor": 0.6, | |
| "drawStyle": "line", | |
| "fillOpacity": 15, | |
| "gradientMode": "opacity", | |
| "hideFrom": { | |
| "legend": false, | |
| "tooltip": false, | |
| "viz": false | |
| }, | |
| "insertNulls": false, | |
| "lineInterpolation": "smooth", | |
| "lineWidth": 2, | |
| "pointSize": 5, | |
| "scaleDistribution": { | |
| "type": "linear" | |
| }, | |
| "showPoints": "auto", | |
| "showValues": false, | |
| "spanNulls": false, | |
| "stacking": { | |
| "group": "A", | |
| "mode": "none" | |
| }, | |
| "thresholdsStyle": { | |
| "mode": "off" | |
| } | |
| }, | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "green", | |
| "value": 0 | |
| }, | |
| { | |
| "color": "red", | |
| "value": 80 | |
| } | |
| ] | |
| }, | |
| "unit": "short" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "legend": { | |
| "calcs": [ | |
| "mean", | |
| "max" | |
| ], | |
| "displayMode": "table", | |
| "placement": "bottom", | |
| "showLegend": true | |
| }, | |
| "tooltip": { | |
| "hideZeros": false, | |
| "mode": "multi", | |
| "sort": "desc" | |
| } | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-41": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum by (model) (rate(claude_code_token_usage_tokens_total[5m]))", | |
| "legendFormat": "{{model}}" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "Token consumption rate by model", | |
| "id": 41, | |
| "links": [], | |
| "title": "Token Usage by Model Over Time", | |
| "vizConfig": { | |
| "group": "timeseries", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "color": { | |
| "mode": "palette-classic" | |
| }, | |
| "custom": { | |
| "axisBorderShow": false, | |
| "axisCenteredZero": false, | |
| "axisColorMode": "text", | |
| "axisLabel": "tokens/sec", | |
| "axisPlacement": "auto", | |
| "barAlignment": 0, | |
| "barWidthFactor": 0.6, | |
| "drawStyle": "line", | |
| "fillOpacity": 15, | |
| "gradientMode": "opacity", | |
| "hideFrom": { | |
| "legend": false, | |
| "tooltip": false, | |
| "viz": false | |
| }, | |
| "insertNulls": false, | |
| "lineInterpolation": "smooth", | |
| "lineWidth": 2, | |
| "pointSize": 5, | |
| "scaleDistribution": { | |
| "type": "linear" | |
| }, | |
| "showPoints": "auto", | |
| "showValues": false, | |
| "spanNulls": false, | |
| "stacking": { | |
| "group": "A", | |
| "mode": "none" | |
| }, | |
| "thresholdsStyle": { | |
| "mode": "off" | |
| } | |
| }, | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "green", | |
| "value": 0 | |
| }, | |
| { | |
| "color": "red", | |
| "value": 80 | |
| } | |
| ] | |
| }, | |
| "unit": "short" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "legend": { | |
| "calcs": [ | |
| "mean", | |
| "max" | |
| ], | |
| "displayMode": "table", | |
| "placement": "bottom", | |
| "showLegend": true | |
| }, | |
| "tooltip": { | |
| "hideZeros": false, | |
| "mode": "multi", | |
| "sort": "desc" | |
| } | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-42": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum by (model) (rate(claude_code_cost_usage_USD_total[5m])) * 300", | |
| "legendFormat": "{{model}}" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "API cost accumulation rate", | |
| "id": 42, | |
| "links": [], | |
| "title": "Cost Over Time", | |
| "vizConfig": { | |
| "group": "timeseries", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "color": { | |
| "mode": "palette-classic" | |
| }, | |
| "custom": { | |
| "axisBorderShow": false, | |
| "axisCenteredZero": false, | |
| "axisColorMode": "text", | |
| "axisLabel": "$/5min", | |
| "axisPlacement": "auto", | |
| "barAlignment": 0, | |
| "barWidthFactor": 0.6, | |
| "drawStyle": "line", | |
| "fillOpacity": 20, | |
| "gradientMode": "scheme", | |
| "hideFrom": { | |
| "legend": false, | |
| "tooltip": false, | |
| "viz": false | |
| }, | |
| "insertNulls": false, | |
| "lineInterpolation": "smooth", | |
| "lineWidth": 2, | |
| "pointSize": 5, | |
| "scaleDistribution": { | |
| "type": "linear" | |
| }, | |
| "showPoints": "auto", | |
| "showValues": false, | |
| "spanNulls": false, | |
| "stacking": { | |
| "group": "A", | |
| "mode": "none" | |
| }, | |
| "thresholdsStyle": { | |
| "mode": "off" | |
| } | |
| }, | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "green", | |
| "value": 0 | |
| }, | |
| { | |
| "color": "red", | |
| "value": 80 | |
| } | |
| ] | |
| }, | |
| "unit": "currencyUSD" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "legend": { | |
| "calcs": [ | |
| "mean", | |
| "sum" | |
| ], | |
| "displayMode": "table", | |
| "placement": "bottom", | |
| "showLegend": true | |
| }, | |
| "tooltip": { | |
| "hideZeros": false, | |
| "mode": "multi", | |
| "sort": "desc" | |
| } | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-43": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum by (type) (rate(claude_code_active_time_seconds_total[5m]))", | |
| "legendFormat": "{{type}}" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "CLI and User activity rate", | |
| "id": 43, | |
| "links": [], | |
| "title": "Active Time Over Time", | |
| "vizConfig": { | |
| "group": "timeseries", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "color": { | |
| "mode": "palette-classic" | |
| }, | |
| "custom": { | |
| "axisBorderShow": false, | |
| "axisCenteredZero": false, | |
| "axisColorMode": "text", | |
| "axisLabel": "activity rate", | |
| "axisPlacement": "auto", | |
| "barAlignment": 0, | |
| "barWidthFactor": 0.6, | |
| "drawStyle": "line", | |
| "fillOpacity": 20, | |
| "gradientMode": "opacity", | |
| "hideFrom": { | |
| "legend": false, | |
| "tooltip": false, | |
| "viz": false | |
| }, | |
| "insertNulls": false, | |
| "lineInterpolation": "smooth", | |
| "lineWidth": 2, | |
| "pointSize": 5, | |
| "scaleDistribution": { | |
| "type": "linear" | |
| }, | |
| "showPoints": "auto", | |
| "showValues": false, | |
| "spanNulls": false, | |
| "stacking": { | |
| "group": "A", | |
| "mode": "none" | |
| }, | |
| "thresholdsStyle": { | |
| "mode": "off" | |
| } | |
| }, | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "green", | |
| "value": 0 | |
| }, | |
| { | |
| "color": "red", | |
| "value": 80 | |
| } | |
| ] | |
| }, | |
| "unit": "short" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "legend": { | |
| "calcs": [ | |
| "mean", | |
| "max" | |
| ], | |
| "displayMode": "table", | |
| "placement": "bottom", | |
| "showLegend": true | |
| }, | |
| "tooltip": { | |
| "hideZeros": false, | |
| "mode": "multi", | |
| "sort": "desc" | |
| } | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-5": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum(claude_code_cost_usage_USD_total)" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "Total API cost in USD", | |
| "id": 5, | |
| "links": [], | |
| "title": "Total Cost", | |
| "vizConfig": { | |
| "group": "stat", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "decimals": 2, | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "green", | |
| "value": 0 | |
| }, | |
| { | |
| "color": "yellow", | |
| "value": 10 | |
| }, | |
| { | |
| "color": "red", | |
| "value": 50 | |
| } | |
| ] | |
| }, | |
| "unit": "currencyUSD" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "colorMode": "value", | |
| "graphMode": "area", | |
| "justifyMode": "center", | |
| "orientation": "auto", | |
| "percentChangeColorMode": "standard", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "showPercentChange": false, | |
| "textMode": "auto", | |
| "wideLayout": true | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| }, | |
| "panel-6": { | |
| "kind": "Panel", | |
| "spec": { | |
| "data": { | |
| "kind": "QueryGroup", | |
| "spec": { | |
| "queries": [ | |
| { | |
| "kind": "PanelQuery", | |
| "spec": { | |
| "hidden": false, | |
| "query": { | |
| "group": "prometheus", | |
| "kind": "DataQuery", | |
| "spec": { | |
| "expr": "sum(sum_over_time(claude_code_lines_of_code_count_total[$__range]))", | |
| "legendFormat": "Lines Accepted" | |
| }, | |
| "version": "v0" | |
| }, | |
| "refId": "A" | |
| } | |
| } | |
| ], | |
| "queryOptions": {}, | |
| "transformations": [] | |
| } | |
| }, | |
| "description": "Lines of code accepted from Claude suggestions", | |
| "id": 6, | |
| "links": [], | |
| "title": "Lines of Code", | |
| "vizConfig": { | |
| "group": "stat", | |
| "kind": "VizConfig", | |
| "spec": { | |
| "fieldConfig": { | |
| "defaults": { | |
| "thresholds": { | |
| "mode": "absolute", | |
| "steps": [ | |
| { | |
| "color": "semi-dark-green", | |
| "value": 0 | |
| } | |
| ] | |
| }, | |
| "unit": "none" | |
| }, | |
| "overrides": [] | |
| }, | |
| "options": { | |
| "colorMode": "value", | |
| "graphMode": "area", | |
| "justifyMode": "center", | |
| "orientation": "auto", | |
| "percentChangeColorMode": "standard", | |
| "reduceOptions": { | |
| "calcs": [ | |
| "lastNotNull" | |
| ], | |
| "fields": "", | |
| "values": false | |
| }, | |
| "showPercentChange": false, | |
| "textMode": "auto", | |
| "wideLayout": true | |
| } | |
| }, | |
| "version": "12.3.0" | |
| } | |
| } | |
| } | |
| }, | |
| "layout": { | |
| "kind": "GridLayout", | |
| "spec": { | |
| "items": [] | |
| } | |
| }, | |
| "links": [], | |
| "liveNow": false, | |
| "preload": false, | |
| "tags": [ | |
| "claude", | |
| "productivity", | |
| "ai", | |
| "development" | |
| ], | |
| "timeSettings": { | |
| "autoRefresh": "auto", | |
| "autoRefreshIntervals": [ | |
| "5s", | |
| "10s", | |
| "30s", | |
| "1m", | |
| "5m", | |
| "15m", | |
| "30m", | |
| "1h", | |
| "2h", | |
| "1d" | |
| ], | |
| "fiscalYearStartMonth": 0, | |
| "from": "now-1h", | |
| "hideTimepicker": false, | |
| "timezone": "browser", | |
| "to": "now" | |
| }, | |
| "title": "Claude Code Metrics", | |
| "variables": [] | |
| }, | |
| "status": {} | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment