Skip to content

Engineering ยท 7 min read ยท January 2026

Why cost intelligence should live in your CI/CD pipeline

By the AravaliStack Cost Intelligence TeamEngineeringCostDevOps
โ† Back to Blog

Most organisations treat infrastructure cost as a finance problem. The monthly cloud bill arrives, finance investigates, engineering gets a memo asking for "cost optimisation," and for two weeks everyone is conscious of their resource usage. Then the cycle repeats.

This approach has a fundamental flaw: the people who receive the bill (finance) are not the people who made the decisions that created the bill (engineers). And the people who made the decisions made them weeks or months ago, in a context they no longer remember, without any visibility into the cost implications at the time.

The fix is conceptually simple: put cost information where engineering decisions are made. For modern software teams, that means the CI/CD pipeline.

The feedback loop that changes behaviour

When an engineer opens a pull request that changes a Kubernetes deployment manifest โ€” increasing replica count, upgrading to a larger instance type, adding a new sidecar container โ€” they are making a cost decision. They almost certainly don't think of it that way. They're solving an application problem.

Now imagine that the CI pipeline runs a cost estimate and posts a comment on the PR:

## AravaliStack Cost Impact Analysis Comparing: main โ†’ feature/increase-replicas payments-api: Replicas: 3 โ†’ 6 CPU (req): 1.5 cores โ†’ 3.0 cores Memory (req): 3 GB โ†’ 6 GB ## Estimated monthly cost change Before: โ‚น18,400 / month After: โ‚น36,800 / month Delta: +โ‚น18,400 / month (+100%) ## Budget status Team budget: โ‚น2,40,000 / month Current spend: โ‚น1,95,000 / month After merge: โ‚น2,13,400 / month โœ“ Within budget ## Note This change will consume 39% of remaining monthly budget.

The engineer now has the information they need to make a decision. They can ask: is the performance improvement worth twice the cost? Can I achieve the same result with 4 replicas instead of 6? Should I talk to my team lead before merging this?

None of this stops the engineer from merging the change. It gives them information. That is the entire intervention โ€” information, at the moment when it is useful.

The reason engineers make expensive infrastructure choices is not that they don't care about cost. It is that they don't have cost information when they're making the choices. Give them the information. The behaviour changes.

Three things that happen when you do this

1. Engineers start thinking about cost as a design parameter

Within weeks of deploying cost estimates in pull requests, we consistently see the same pattern in our customer deployments: engineers start designing around cost efficiency without being asked. They choose smaller instance types when they can. They set appropriate resource requests. They ask whether they actually need the replica count they were about to set. This is not because they're being forced to โ€” it's because they now have the context to make informed tradeoffs.

2. Budget conversations move from retrospective to prospective

Cost reviews stop being "why was last month's bill so high?" and start being "this planned change to the payments service will cost an extra โ‚น18,400/month โ€” do we approve it?" Finance and engineering are now having the same conversation, about the same decision, at the same time. The budget review cadence doesn't have to change; the quality of the conversation changes entirely.

3. Cost anomalies are caught before they compound

A misconfigured deployment that consumes 10x expected resources will appear as a large cost delta in the CI pipeline at deployment time. In the traditional model, it appears as a line item in the monthly bill three to four weeks later, by which time it has been running at 10x cost for the entire period. Early detection is not a marginal improvement. It is the difference between a โ‚น50,000 anomaly and a โ‚น15,00,000 one.

What the implementation looks like

AravaliStack implements this through a combination of OpenCost (for resource pricing data), Kubernetes resource request parsing (from the manifest diff), and a pipeline plugin that calculates the delta and posts the comment.

The key implementation decisions:

  • Use resource requests, not limits. Limits are theoretical maximums. Requests are what the scheduler actually allocates. Cost should be calculated on what the cluster commits, not what the application might theoretically consume.
  • Show the delta, not just the absolute cost. An engineer doesn't need to know the total cost of every deployment. They need to know what their change adds. The delta is the signal.
  • Show budget status. The delta is meaningless without context. Knowing that you're spending an extra โ‚น18,400/month means something very different if you have โ‚น10,000 remaining in your budget versus โ‚น2,00,000 remaining.
  • Don't block deploys on cost. Information, not gates. Gates create resentment and workarounds. Information creates culture change. (Exception: if a change would breach a hard budget limit, the pipeline can post a warning that requires explicit override โ€” but this should be rare by design.)

Extending it to AI workloads

As LLM-based features become part of enterprise applications, the same principle extends to AI inference costs. An engineer adding a "summarise this document" feature backed by an LLM inference call should see, in their PR, an estimate of the token cost at the expected usage volume.

This is increasingly important: at scale, LLM inference costs can easily exceed compute infrastructure costs. An enterprise application making 500,000 LLM API calls per day at โ‚น0.15 per call is spending โ‚น75,000 per day on inference alone โ€” a cost that is completely invisible in the traditional model until it appears on the bill.

A practical starting point: You don't need to instrument everything on day one. Start with one team, one service, one pipeline. Show engineers the cost delta on their PRs for four weeks. Then measure whether resource request accuracy improves and whether the team's infrastructure spend-per-feature changes. The numbers will make the case for broader rollout.

Infrastructure cost is an engineering problem that has been delegated to finance for decades. The right fix is not better financial reporting โ€” it is better engineering feedback loops. The CI/CD pipeline is where engineers spend their time. That is where cost information belongs.