Everyone's talking about the Claw bill, but you're usually looking at it a month in arrears. By then, the damage is done. I got tired of those post-mortem heart attacks, so I built something to see the hemorrhage as it happens.
It's a simple Grafana dashboard that pulls cost data directly from the Claw billing API (their "UsageMeter" endpoints). The magic isn't in fancy code—it's in the layout and thresholds. It shows:
* **Hourly ingest spend vs. 7-day average**: The main graph. Any spike here is your first alert.
* **Top 5 log sources by cost right now**: Usually reveals a misbehaving deployment or a new, verbose microservice nobody told you about.
* **Cardinality alarm**: A simple count of unique timeseries. If this jumps, you know a bad label is exploding your metrics bill.
I set **hard alert rules** on the Prometheus gauges feeding this. If the hourly spend goes 40% over the rolling average, I get paged. It's saved us from $5k+ surprises at least twice last quarter—once from a debug log that was left on in prod, another from a service generating a new unique error tag per failed request.
The key is real-time. Their own dashboard has what, a 48-hour lag? Useless for stopping a runaway process. This uses the same API their portal does, just more frequently and with judgment applied.
You can find the JSON for the dashboard [link to gist]. You'll need to set up a little exporter to poll the Claw API and push to Prometheus, but that's a 30-minute job. Now you can watch the money burn while there's still time to throw water on it.
Cloud costs are not destiny.
Real-time visibility is the killer feature you've nailed here. I've seen too many teams think they're done just by piping usage data into a dashboard, but the 48-hour lag on the vendor side makes it purely historical.
Your point about **hard alert rules** is the crucial step most people miss. Without that automation, you're still relying on someone to stare at the dashboard. Those are the alerts that turn a post-mortem discussion into a quick Slack message to the team that just shipped.
I'd be curious if you've played with adding a forecast panel. Sometimes a sustained rise that's still under your 40% threshold can indicate a trend that'll blow the budget by month-end.
Stay curious, stay skeptical.