From 3877e75e40c309c9170beed535f568c24422cdf1 Mon Sep 17 00:00:00 2001 From: "bo.huang@datadoghq.com" Date: Fri, 8 May 2026 09:29:45 -0400 Subject: [PATCH] [FRWEBINT-1677] Add Claude Code Costs widget group to Anthropic dashboard Surfaces the new cost_type:session_usage CCM tag (added in DataDog/dogweb#166424) so customers can see Claude Code spend separately from API token spend. The new group has: - A query_value showing total Claude Code spend over the past 30d. - A timeseries breaking daily Claude Code spend down by workspace. - A note explaining how this differs from the existing token-based widgets. Customer: Digital Asset (FRWEBINT-1677). --- anthropic_usage_and_costs/CHANGELOG.md | 6 + .../anthropic_usage_and_costs_overview.json | 135 +++++++++++++++++- 2 files changed, 140 insertions(+), 1 deletion(-) diff --git a/anthropic_usage_and_costs/CHANGELOG.md b/anthropic_usage_and_costs/CHANGELOG.md index 0e19363746dea..9f1a5d8770949 100644 --- a/anthropic_usage_and_costs/CHANGELOG.md +++ b/anthropic_usage_and_costs/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG - Anthropic Usage and Costs +## 1.1.0 / 2026-05-08 + +***Added***: + +* Add "Claude Code Costs" group to the overview dashboard, surfacing Anthropic Claude Code metered/session billing (`cost_type:session_usage`) separately from API token spend. + ## 1.0.0 / 2025-08-02 ***Added***: diff --git a/anthropic_usage_and_costs/assets/dashboards/anthropic_usage_and_costs_overview.json b/anthropic_usage_and_costs/assets/dashboards/anthropic_usage_and_costs_overview.json index 3bef91ebb3c3b..d7e450bf1b91f 100644 --- a/anthropic_usage_and_costs/assets/dashboards/anthropic_usage_and_costs_overview.json +++ b/anthropic_usage_and_costs/assets/dashboards/anthropic_usage_and_costs_overview.json @@ -2234,6 +2234,139 @@ "width": 12, "height": 10 } + }, + { + "id": 8885191409050301, + "definition": { + "title": "Claude Code Costs", + "type": "group", + "show_title": true, + "layout_type": "ordered", + "widgets": [ + { + "id": 8885191409050302, + "definition": { + "title": "Claude Code Spend (past 30d)", + "title_size": "16", + "title_align": "left", + "type": "query_value", + "requests": [ + { + "formulas": [ + { + "formula": "query1" + } + ], + "queries": [ + { + "data_source": "cloud_cost", + "name": "query1", + "query": "sum:all.cost{providername:Anthropic,cost_type:session_usage,$workspace_name,$organization_name,$user_name,$email}.rollup(sum, 2592000)", + "aggregator": "sum" + } + ], + "response_format": "scalar" + } + ], + "autoscale": true, + "precision": 2, + "timeseries_background": { + "type": "bars" + }, + "time": { + "type": "live", + "unit": "month", + "value": 1, + "hide_incomplete_cost_data": true + } + }, + "layout": { + "x": 0, + "y": 0, + "width": 4, + "height": 3 + } + }, + { + "id": 8885191409050303, + "definition": { + "title": "Daily Claude Code Costs by Workspace (30 Days)", + "show_legend": true, + "legend_layout": "horizontal", + "legend_columns": [ + "avg", + "min", + "max", + "value", + "sum" + ], + "time": { + "type": "live", + "unit": "month", + "value": 1, + "hide_incomplete_cost_data": true + }, + "type": "timeseries", + "requests": [ + { + "formulas": [ + { + "formula": "query1" + } + ], + "queries": [ + { + "data_source": "cloud_cost", + "name": "query1", + "query": "sum:all.cost{providername:Anthropic,cost_type:session_usage,$workspace_name,$organization_name,$user_name,$email} by {workspace_name}.rollup(sum, daily)" + } + ], + "response_format": "timeseries", + "style": { + "palette": "dog_classic", + "line_type": "solid", + "line_width": "normal" + }, + "display_type": "bars" + } + ] + }, + "layout": { + "x": 4, + "y": 0, + "width": 8, + "height": 3 + } + }, + { + "id": 8885191409050304, + "definition": { + "type": "note", + "content": "**Claude Code Costs** captures Anthropic Claude Code metered/session billing (`cost_type:session_usage`), separate from API token spend. Use the workspace breakdown to see per-team allocation. For per-user attribution, see the `claude_code.estimated_cost` metric (gauge, not CCM).", + "background_color": "blue", + "font_size": "14", + "text_align": "left", + "vertical_align": "top", + "show_tick": false, + "tick_pos": "50%", + "tick_edge": "left", + "has_padding": true + }, + "layout": { + "x": 0, + "y": 3, + "width": 12, + "height": 2 + } + } + ] + }, + "layout": { + "x": 0, + "y": 77, + "width": 12, + "height": 6 + } } ], "template_variables": [ @@ -2277,4 +2410,4 @@ "layout_type": "ordered", "notify_list": [], "reflow_type": "fixed" -} \ No newline at end of file +}