# ClickHouse Cloud spend explorer with per-team budgets

> Open one screen to see what your ClickHouse Cloud warehouse cost, break it down by service and owning team, and flag anyone over budget.

- Workflow type: app
- Services: ClickHouse Cloud, Google Sheets
- Categories: Finance, Engineering
- Published: 2026-08-16

## What it does

- See total ClickHouse Cloud spend for any date range, split across compute, storage, backups and data transfer, with a trend chart of how it moved.
- Break spend down service by service, with each line showing the service name, region, size and the team that owns it.
- Set a monthly budget per team and flag any team that goes over, so overspend surfaces before the invoice does.
- Compare this period against the one before it to see which services moved most, then push the breakdown into your finance spreadsheet in one click.

## What you'll need

- A ClickHouse Cloud account with an API key that can read your organization's usage and services.
- A Google account with access to the spreadsheet you want to export into.
- A rough idea of which teams own which services, either as tags on the services or just in your head.

## Prompt

Build me an internal app called ClickHouse Cloud Spend Explorer that our finance team and our data team can open together to answer one question: what did the warehouse cost us, and who spent it. It is a read-mostly reporting surface with a small amount of configuration it stores itself. Nothing runs on a schedule, a person opens it and explores.

The first tab is Overview. At the top put a date range picker with one-click presets for This month, Last month, Last 30 days, Last 90 days and Quarter to date, plus a custom range. Whatever range is selected drives the entire app. Pull the numbers with ClickHouse Cloud Get Organization Usage Costs for that range and show a headline total spend figure, then a row of cards splitting the total across compute, storage, backups and data transfer, each showing its share of the total as a percentage. Below that put a trend chart of spend across the range, with a toggle to stack it by those same cost categories so we can see which line item is actually growing.

The second tab is By service. Take the same cost report and break it down per service, then enrich each line so it is readable by someone who does not live in the console: call List Services to get every service in the organization and Get Service for the detail, so each row carries the service name, region, size and tags alongside its cost for the period. Make the table sortable by cost and filterable by region and by team.

Every service should map to an owning team. Resolve the team from the service tags first, using a tag key I can configure with a default of team. Where a service has no usable tag, fall back to a manual mapping that the app stores itself, and give me a small Team mapping screen where I can assign any unmapped or mis-tagged service to a team by hand. Show clearly which rows got their team from a tag and which came from the manual mapping, and surface a count of still-unassigned services so the mapping does not silently rot as new services appear.

In the same settings area let me set a monthly budget per team. On the By service tab add a per-team rollup that sums each team's spend for the selected period against its budget and flags any team over its number, with a softer warning band as a team gets close. Important detail: when the selected range is not a full calendar month, prorate the monthly budget to the length of the range for that comparison and label it on screen, so nobody reads a half month of spend as being comfortably under budget.

Add a compare control that puts the selected period next to the period immediately before it of the same length. When compare is on, every cost figure gains a delta in both dollars and percent, and the By service table gains a Biggest movers view that sorts by absolute change so the services whose cost moved most rise to the top. Call out separately any service that is new in this period with no prior spend, and any service that dropped to zero, since both wreck a percentage change and should not be presented as an infinite increase.

Put an Export button on the By service tab that appends the current breakdown to our finance spreadsheet using Google Sheets Append Values. Let me pick or paste the spreadsheet and the tab, and write one row per service carrying the period start and end dates, service name, region, size, owning team, cost by category, total cost and the budget status. Always append, never overwrite, so the sheet accumulates a history we can pivot on later, and stamp every row with the export time. Confirm in the UI how many rows were written.

A few practical things to get right. The cost report takes plain calendar dates in YYYY-MM-DD form, so every preset must resolve to exact start and end dates and the app should never send timestamps. Look up the organization id once with List Organizations before requesting costs or services, and if the API key can see more than one organization let me choose which one I am looking at. Service detail lookups are one call per service and the API is rate limited, so fetch service metadata once per load and cache it for the session instead of refetching on every filter or sort. Show a loading state while the report is being assembled, and if the cost report comes back empty for a range say so plainly rather than rendering an empty chart. Format money as currency everywhere, and keep the whole thing legible to someone in finance who has never opened ClickHouse.

## How to customize

- Change which service tag identifies the owning team, or map services to teams by hand inside the app.
- Set or update the monthly budget for each team, and adjust how close to the limit triggers a warning.
- Choose your own preset date ranges and pick which spreadsheet and tab the export appends to.

## FAQ

### Does this change anything in my ClickHouse Cloud account?

No. The app only reads your usage costs and service details. The one thing it writes anywhere is the rows it appends to your spreadsheet when you press export, plus the team mapping and budgets it stores for itself.

### What if our services are not tagged with a team?

That is expected, and the app is built for it. It reads team tags where they exist and lets you assign everything else by hand inside the app. It also shows how many services are still unassigned, so the mapping does not quietly go stale.

### Can finance use this without knowing anything about databases?

Yes. Every line shows a plain service name, its region and size, the team that owns it and what it cost for the period. Nobody needs to open the ClickHouse console to read it.

### How far back can I look?

You can pick any date range your ClickHouse Cloud usage history covers, with one-click presets for this month, last month and the last 30 days when you do not want to fiddle with a calendar.

### Does the export overwrite my spreadsheet?

No. Each export adds new rows to the bottom of the tab you choose, with the period and a timestamp on every row, so the sheet builds up a history you can pivot on later.

Use this prompt in General Input: https://www.generalinput.com/prompts/clickhouse-cloud-spend-explorer-with-per-team-budgets