{ "variables": [ { "type": "property", "property": "region", "inputType": "select", "id": "REGION", "label": "Region", "defaultValue": "us-east-1", "visible": true, "values": [ { "value": "us-east-1", "label": "US East (N. Virginia)" }, { "value": "us-east-2", "label": "US East (Ohio)" }, { "value": "us-west-1", "label": "US West (N. California)" }, { "value": "us-west-2", "label": "US West (Oregon)" }, { "value": "af-south-1", "label": "Africa (Cape Town)" }, { "value": "ap-east-1", "label": "Asia Pacific (Hong Kong)" }, { "value": "ap-east-2", "label": "Asia Pacific (Taipei)" }, { "value": "ap-south-1", "label": "Asia Pacific (Mumbai)" }, { "value": "ap-south-2", "label": "Asia Pacific (Hyderabad)" }, { "value": "ap-southeast-1", "label": "Asia Pacific (Singapore)" }, { "value": "ap-southeast-2", "label": "Asia Pacific (Sydney)" }, { "value": "ap-southeast-3", "label": "Asia Pacific (Jakarta)" }, { "value": "ap-southeast-4", "label": "Asia Pacific (Melbourne)" }, { "value": "ap-southeast-5", "label": "Asia Pacific (Malaysia)" }, { "value": "ap-southeast-6", "label": "Asia Pacific (Auckland)" }, { "value": "ap-southeast-7", "label": "Asia Pacific (Thailand)" }, { "value": "ap-northeast-1", "label": "Asia Pacific (Tokyo)" }, { "value": "ap-northeast-2", "label": "Asia Pacific (Seoul)" }, { "value": "ap-northeast-3", "label": "Asia Pacific (Osaka)" }, { "value": "ca-central-1", "label": "Canada (Central)" }, { "value": "ca-west-1", "label": "Canada West (Calgary)" }, { "value": "eu-central-1", "label": "Europe (Frankfurt)" }, { "value": "eu-central-2", "label": "Europe (Zurich)" }, { "value": "eu-west-1", "label": "Europe (Ireland)" }, { "value": "eu-west-2", "label": "Europe (London)" }, { "value": "eu-west-3", "label": "Europe (Paris)" }, { "value": "eu-north-1", "label": "Europe (Stockholm)" }, { "value": "eu-south-1", "label": "Europe (Milan)" }, { "value": "eu-south-2", "label": "Europe (Spain)" }, { "value": "mx-central-1", "label": "Mexico (Central)" }, { "value": "sa-east-1", "label": "South America (São Paulo)" } ] } ], "widgets": [ { "type": "text", "x": 0, "y": 0, "width": 24, "height": 2, "properties": { "markdown": "## Overview", "background": "transparent" } }, { "type": "chart", "x": 0, "y": 2, "width": 6, "height": 4, "properties": { "title": "Total Tokens Used", "view": "number", "region": "${REGION}", "data": { "queries": [{ "id": "a", "type": "cloudwatch-metrics", "language": "PromQL", "query": "sum({\"claude_code.token.usage\", \"@resource.service.name\"=\"claude-code\"})", "step": 60, "label": "Tokens" }] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": false, "stacked": false, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "chart", "x": 6, "y": 2, "width": 6, "height": 4, "properties": { "title": "Active Users", "view": "number", "region": "${REGION}", "data": { "queries": [{ "id": "a", "type": "cloudwatch-metrics", "language": "PromQL", "query": "count(group by (\"user.email\")({\"claude_code.session.count\", \"@resource.service.name\"=\"claude-code\"}))", "step": 60, "label": "Users" }] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": false, "stacked": false, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "chart", "x": 12, "y": 2, "width": 6, "height": 4, "properties": { "title": "Sessions", "view": "number", "region": "${REGION}", "data": { "queries": [{ "id": "a", "type": "cloudwatch-metrics", "language": "PromQL", "query": "sum({\"claude_code.session.count\", \"@resource.service.name\"=\"claude-code\"})", "step": 60, "label": "Sessions" }] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": false, "stacked": false, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "chart", "x": 18, "y": 2, "width": 6, "height": 4, "properties": { "title": "Cache Hit Rate", "view": "number", "region": "${REGION}", "data": { "queries": [{ "id": "a", "type": "cloudwatch-metrics", "language": "PromQL", "query": "sum({\"claude_code.token.usage\", type=\"cacheRead\", \"@resource.service.name\"=\"claude-code\"}) / sum({\"claude_code.token.usage\", \"@resource.service.name\"=\"claude-code\"}) * 100", "step": 60, "label": "%" }] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": false, "stacked": false, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "text", "x": 0, "y": 6, "width": 24, "height": 2, "properties": { "markdown": "## Token Usage", "background": "transparent" } }, { "type": "chart", "x": 0, "y": 8, "width": 12, "height": 6, "properties": { "title": "Token Usage Over Time", "view": "line", "region": "${REGION}", "data": { "queries": [ { "id": "total", "type": "cloudwatch-metrics", "language": "PromQL", "query": "sum({\"claude_code.token.usage\", \"@resource.service.name\"=\"claude-code\"})", "step": 60, "label": "Total Tokens" } ] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": true, "stacked": false, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "chart", "x": 12, "y": 8, "width": 12, "height": 6, "properties": { "title": "Token Usage by Type", "view": "line", "region": "${REGION}", "data": { "queries": [ { "id": "input", "type": "cloudwatch-metrics", "language": "PromQL", "query": "sum({\"claude_code.token.usage\", type=\"input\", \"@resource.service.name\"=\"claude-code\"})", "step": 60, "label": "Input" }, { "id": "output", "type": "cloudwatch-metrics", "language": "PromQL", "query": "sum({\"claude_code.token.usage\", type=\"output\", \"@resource.service.name\"=\"claude-code\"})", "step": 60, "label": "Output" }, { "id": "cache", "type": "cloudwatch-metrics", "language": "PromQL", "query": "sum({\"claude_code.token.usage\", type=\"cacheRead\", \"@resource.service.name\"=\"claude-code\"})", "step": 60, "label": "Cache Read" }, { "id": "cacheCreate", "type": "cloudwatch-metrics", "language": "PromQL", "query": "sum({\"claude_code.token.usage\", type=\"cacheCreation\", \"@resource.service.name\"=\"claude-code\"})", "step": 60, "label": "Cache Creation" } ] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": false, "stacked": false, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "chart", "x": 0, "y": 14, "width": 12, "height": 6, "properties": { "title": "Token Usage by Model", "view": "line", "region": "${REGION}", "data": { "queries": [ { "id": "a", "type": "cloudwatch-metrics", "language": "PromQL", "query": "topk(500, sum by (model)({\"claude_code.token.usage\", \"@resource.service.name\"=\"claude-code\"}))", "step": 60 } ] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": false, "stacked": true, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "chart", "x": 12, "y": 14, "width": 12, "height": 6, "properties": { "title": "Top Users by Token Usage", "view": "line", "region": "${REGION}", "data": { "queries": [ { "id": "a", "type": "cloudwatch-metrics", "language": "PromQL", "query": "topk(500, sum by (\"user.email\")({\"claude_code.token.usage\", \"@resource.service.name\"=\"claude-code\"}))", "step": 60 } ] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": false, "stacked": false, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "chart", "x": 0, "y": 20, "width": 12, "height": 6, "properties": { "title": "Estimated Cost by User (USD)", "view": "line", "region": "${REGION}", "data": { "queries": [ { "id": "a", "type": "cloudwatch-metrics", "language": "PromQL", "query": "topk(500, sum by (\"user.email\")({\"claude_code.cost.usage\", \"@resource.service.name\"=\"claude-code\"}))", "step": 60 } ] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": false, "stacked": false, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "chart", "x": 12, "y": 20, "width": 12, "height": 6, "properties": { "title": "Active Users Over Time", "view": "line", "region": "${REGION}", "data": { "queries": [ { "id": "a", "type": "cloudwatch-metrics", "language": "PromQL", "query": "count(group by (\"user.email\")({\"claude_code.session.count\", \"@resource.service.name\"=\"claude-code\"}))", "step": 60, "label": "Active Users" } ] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": true, "stacked": false, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "text", "x": 0, "y": 26, "width": 24, "height": 2, "properties": { "markdown": "## Developer Productivity", "background": "transparent" } }, { "type": "chart", "x": 0, "y": 28, "width": 6, "height": 6, "properties": { "title": "Lines of Code", "view": "line", "region": "${REGION}", "data": { "queries": [ { "id": "added", "type": "cloudwatch-metrics", "language": "PromQL", "query": "sum({\"claude_code.lines_of_code.count\", type=\"added\", \"@resource.service.name\"=\"claude-code\"})", "step": 60, "label": "Added" }, { "id": "removed", "type": "cloudwatch-metrics", "language": "PromQL", "query": "sum({\"claude_code.lines_of_code.count\", type=\"removed\", \"@resource.service.name\"=\"claude-code\"})", "step": 60, "label": "Removed" } ] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": false, "stacked": false, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "chart", "x": 6, "y": 28, "width": 6, "height": 6, "properties": { "title": "Commits", "view": "line", "region": "${REGION}", "data": { "queries": [ { "id": "a", "type": "cloudwatch-metrics", "language": "PromQL", "query": "sum({\"claude_code.commit.count\", \"@resource.service.name\"=\"claude-code\"})", "step": 60, "label": "Commits" } ] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": true, "stacked": false, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "chart", "x": 12, "y": 28, "width": 6, "height": 6, "properties": { "title": "Active Hours", "view": "line", "region": "${REGION}", "data": { "queries": [ { "id": "a", "type": "cloudwatch-metrics", "language": "PromQL", "query": "sum({\"claude_code.active_time.total\", \"@resource.service.name\"=\"claude-code\"}) / 3600", "step": 60, "label": "Hours" } ] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": true, "stacked": false, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "chart", "x": 18, "y": 28, "width": 6, "height": 6, "properties": { "title": "Pull Requests", "view": "line", "region": "${REGION}", "data": { "queries": [ { "id": "a", "type": "cloudwatch-metrics", "language": "PromQL", "query": "sum({\"claude_code.pull_request.count\", \"@resource.service.name\"=\"claude-code\"})", "step": 60, "label": "PRs" } ] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": true, "stacked": false, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "chart", "x": 0, "y": 34, "width": 8, "height": 6, "properties": { "title": "Code Generation by Language", "view": "pie", "region": "${REGION}", "data": { "queries": [ { "id": "a", "type": "cloudwatch-metrics", "language": "PromQL", "query": "topk(500, sum by (language)({\"claude_code.code_edit_tool.decision\", \"@resource.service.name\"=\"claude-code\"}))", "step": 60 } ] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": true, "stacked": true, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "chart", "x": 8, "y": 34, "width": 8, "height": 6, "properties": { "title": "Code Edit Decisions", "view": "line", "region": "${REGION}", "data": { "queries": [ { "id": "a", "type": "cloudwatch-metrics", "language": "PromQL", "query": "topk(500, sum by (decision)({\"claude_code.code_edit_tool.decision\", \"@resource.service.name\"=\"claude-code\"}))", "step": 60 } ] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": false, "stacked": false, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "chart", "x": 16, "y": 34, "width": 8, "height": 6, "properties": { "title": "Code Edits by Tool", "view": "line", "region": "${REGION}", "data": { "queries": [ { "id": "a", "type": "cloudwatch-metrics", "language": "PromQL", "query": "topk(500, sum by (tool_name)({\"claude_code.code_edit_tool.decision\", \"@resource.service.name\"=\"claude-code\"}))", "step": 60 } ] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": false, "stacked": false, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "text", "x": 0, "y": 40, "width": 24, "height": 2, "properties": { "markdown": "## Organizational Breakdown", "background": "transparent" } }, { "type": "chart", "x": 0, "y": 42, "width": 12, "height": 6, "properties": { "title": "Token Usage by Department", "view": "line", "region": "${REGION}", "data": { "queries": [ { "id": "a", "type": "cloudwatch-metrics", "language": "PromQL", "query": "topk(500, sum by (department)({\"claude_code.token.usage\", \"@resource.service.name\"=\"claude-code\"}))", "step": 60 } ] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": false, "stacked": true, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "chart", "x": 12, "y": 42, "width": 12, "height": 6, "properties": { "title": "Token Usage by Team", "view": "line", "region": "${REGION}", "data": { "queries": [ { "id": "a", "type": "cloudwatch-metrics", "language": "PromQL", "query": "topk(500, sum by (\"team.id\")({\"claude_code.token.usage\", \"@resource.service.name\"=\"claude-code\"}))", "step": 60 } ] }, "plotOptions": { "legend": { "position": "bottom", "show": true }, "xAxis": { "type": "datetime" }, "yAxis": [{ "type": "linear" }], "style": { "lineOptions": { "filled": false, "stacked": true, "width": 2, "pattern": "solid", "spline": false }, "numberOptions": { "sparkline": true }, "pieOptions": { "innerSize": "50%" }, "barOptions": {}, "gaugeOptions": {} } } } }, { "type": "text", "x": 0, "y": 48, "width": 24, "height": 2, "properties": { "markdown": "## Bedrock API Health", "background": "transparent" } }, { "type": "metric", "x": 0, "y": 50, "width": 8, "height": 6, "properties": { "metrics": [ [ { "expression": "SELECT SUM(InvocationThrottles) FROM \"AWS/Bedrock\" GROUP BY ModelId", "id": "throttles" } ] ], "period": 300, "title": "Bedrock Throttles by Model", "yAxis": { "left": { "min": 0 } }, "view": "timeSeries", "stacked": false, "region": "${REGION}" } }, { "type": "metric", "x": 8, "y": 50, "width": 8, "height": 6, "properties": { "metrics": [ [ { "expression": "SELECT SUM(InvocationClientErrors) FROM \"AWS/Bedrock\" GROUP BY ModelId", "id": "client_errors" } ] ], "period": 300, "title": "Bedrock Client Errors by Model", "yAxis": { "left": { "min": 0 } }, "view": "timeSeries", "stacked": false, "region": "${REGION}" } }, { "type": "metric", "x": 16, "y": 50, "width": 8, "height": 6, "properties": { "metrics": [ [ { "expression": "SELECT SUM(InvocationServerErrors) FROM \"AWS/Bedrock\" GROUP BY ModelId", "id": "server_errors" } ] ], "period": 300, "title": "Bedrock Server Errors by Model", "yAxis": { "left": { "min": 0 } }, "view": "timeSeries", "stacked": false, "region": "${REGION}" } } ] }