Skip to content

chore: update cost table guidance#51

Merged
jtroup merged 2 commits intomainfrom
ajk/chore/update-cost-table-guidance
Mar 14, 2026
Merged

chore: update cost table guidance#51
jtroup merged 2 commits intomainfrom
ajk/chore/update-cost-table-guidance

Conversation

@ajkerrigan
Copy link
Contributor

@ajkerrigan ajkerrigan commented Mar 13, 2026

what

Updates sql_info reference documentation to point to our newer FOCUS-inspired tables, in an attempt to obviate CLAUDE.md / AGENTS.md instructions like this:

Cost Queries

Avoid these deprecated tables:

  • account_cost
  • resource_cost
  • resource_cost_summaries

Instead, use the tables below that fit the use case.

Account Costs

  • Daily granularity: account_focus_cost
  • Monthly granularity: account_cost_monthly

Resource Costs

  • Daily granularity: resource_focus_cost
  • Monthly granularity: resource_cost_monthly

why

The FOCUS-styled tables are where we're moving in general. Queries against those tables are more performant, don't require dividing by 1000.0 to get "real" numbers, and leave some AWS bias behind. The additional joins make them more complex though, especially for new folks. Leaning on MCP should help with the transition.

testing

Tested these questions:

  1. Please write a SQL query to smoke test Azure cost ingestion over the past 30 days
  2. Show me the 10 most expensive resources this month

In 3 different scenarios:

  1. Without this change, no explicit CLAUDE.md guidance
  2. Without this change, CLAUDE.md guidance quoted above
  3. With this change, no explicit CLAUDE.md guidance

I found that either the change or CLAUDE.md guidance causes the MCP server to produce "legitimate" cost queries. Without some sql_info.md additions for lookup tables like cost_source, account_id and resource_id, it is more likely to look for non-existent tables or infer too much (example: cost source 1 contains the word "azure" so I don't need to bother pulling account details).

docs

This is in a way a documentation change, but is also intended to align with updates to this Freshdesk page:

How do I interpret Stacklet's cost data?

Without some guidance, we see some cases of:

- Needing a few false starts to find the cost_source table
- Reading too much into cost source names to identify a provider
@ajkerrigan ajkerrigan requested a review from a team as a code owner March 13, 2026 20:22
Copy link
Contributor

@jtroup jtroup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ajkerrigan - I wonder if we want to mention something about cost settings/types too?

@jtroup jtroup merged commit 1e4ddb8 into main Mar 14, 2026
5 checks passed
@jtroup jtroup deleted the ajk/chore/update-cost-table-guidance branch March 14, 2026 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants