CostTrace
Open source · Multi-cloud · FOCUS-native

Know what every deploy really costs.

Cost estimates are guesses. CostTrace reads your actual cloud bill and traces the change in spend back to the pull request that caused it, then checks it against the estimate.

View on GitHub npx costtrace --help
costtrace commented 7 days after deploy

🧾 PR #101: Route payment provider calls through a NAT gateway

9f1c2ab · checkout · deployed 2026-09-08 14:00 UTC
Estimated
+$310
Measured
+$1,376
vs. estimate
4.4×
ResourceProviderChangeAfter / dayMonthly impact
checkout-egress-natAWS · VPCadded$44.02+$1,338.96
checkout-egress-logsAWS · CloudWatchadded$1.21+$36.81

Estimates stop at merge. Your bill doesn't.

Pre-merge tools price what they can see in your infrastructure code. Data processing, traffic, logs and discounts only show up after the change is running.

Pre-merge estimate

List prices for resources declared in your infrastructure code. Useful, but it misses usage-driven charges and your negotiated rates.

CostTrace measurement

Real billed cost from your provider's export, including your discounts, attributed to the exact commit, and compared against the estimate.

Budgets tell you that you overspent. CostTrace tells you why.

Cloud budgets and anomaly alerts work at the level of accounts and services. CostTrace works at the level of the change, and reports to the engineer who made it.

AWS Budgets & anomaly alertsCostTrace
Answers"Are we over plan?""Which change caused it?"
UnitAccount, service, monthPull request, commit, deploy
ReachesFinance, by emailThe engineer, on the PR
Estimate vs. actual—Per change
CloudsOne tool per providerAWS, Azure, GCP, OCI via FOCUS

Use both: when a budget alert fires, CostTrace shows which deploys explain it.

How it works

No agents and no SaaS account. CostTrace runs in your CI or on your laptop against your own billing export.

  1. Tag

    Deploys stamp resources with costtrace_sha, _pr, _repo and _service. One convention that's valid on every cloud.

  2. Measure

    CostTrace reads your FOCUS billing export and compares each touched resource before vs. after the deploy.

  3. Attribute

    Added resources count in full, changed ones by their difference, and removed ones as savings.

  4. Report

    Post a PR comment, print a table, export JSON, or fail CI when a change blows past its estimate.

One tool, every cloud

CostTrace is built on FOCUS, the FinOps Foundation's open billing standard, so the same engine works across providers.

AWSData Exports (FOCUS)
Microsoft AzureCost Management exports
Oracle CloudFOCUS cost reports
Google Cloudvia BigQuery adapter (roadmap)

Try it in a minute

The repository ships with a multi-cloud sample dataset, so you don't need cloud access to see it work.

# measure every change in a deploy log
$ npx costtrace report --focus focus-export.csv --changes changes.json

# a PR comment for one change; fail CI if it's over estimate
$ npx costtrace report --focus focus-export.csv --changes changes.json \
    --sha 9f1c2ab --format markdown --fail-on-over

# the tags your IaC should apply
$ npx costtrace tags --sha "$GITHUB_SHA" --pr 101 --service checkout --format terraform

Built to be trusted with your bill

Runs where you do

Local-first. Your billing data never leaves your machine or CI.

Open source

Apache-2.0 licensed, from the attribution engine to the CLI.

Verifiable releases

Every npm package ships with signed build provenance from GitHub Actions.