Stack SpendDocs

Source control correlation

When a cost anomaly fires, StackSpend automatically looks for the source-control changes — deployed pull requests and commits — that landed just before it and may have contributed, ranks the most likely one, and can explain why with the actual diff. It connects a spend spike to the code behind it, inside StackSpend.

Note.Source control correlation is a Business-plan feature. Connect a Git provider from Settings → Integrations → Source Control.

What it does

After an anomaly is detected, StackSpend finds the deployments and pull requests that shipped in the window before the spike and surfaces the ones most likely to have contributed — ranked, with evidence, in a Change log on the anomaly’s detail page. For the strongest candidate it can run an AI assessment that reads the real diff and points at the specific lines.

It answers the question every team asks after a spend spike: “what did we ship?” — without leaving StackSpend to dig through Git history.

Warning.This is an investigation aid, not a causation engine. StackSpend never claims a pull request caused an anomaly — it surfaces possible contributing changes for an engineer to confirm. The language throughout is “may have contributed” / “consistent with”.

How it works

There is nothing to configure beyond connecting a provider. For each anomaly StackSpend:

  1. finds successful deployments for the affected service in the window before the spike;
  2. resolves each deployment to the pull requests it shipped, and pulls their changed files;
  3. ranks each change by timing (how close to the spike), whether the changed code touches the provider/service that spiked, and whether the diff contains a cost-moving pattern (a model swap, a higher max_tokens, an added retry, a removed cache, a more frequent cron, a scaled-up instance count, and so on);
  4. shows the ranked candidates, and for the strongest one runs the AI assessment.
Tip.You don’t map code to services. StackSpend works out which parts of your repos relate to which cost services automatically (from your dependencies, configuration, infrastructure files, and code owners) — there is no mapping screen to maintain.

Connecting your source control

1

Open Source Control settings

Go to Settings → Integrations → Source Control and choose Connect with GitHub.
2

Install the StackSpend GitHub App

Install the app on your GitHub organization and select the repositories StackSpend may read. You can change the selection at any time.
3

That's it

StackSpend syncs your repositories, deployments and pull requests, and builds its understanding of which code relates to which cost service in the background. Correlation then runs automatically on new anomalies.

StackSpend reads repository metadata, pull requests, deployments, and file diffs for the repositories you select. It does not write to your repositories. GitHub is supported today; more providers are planned.

The Change log

On an anomaly’s detail page, the Change log lists the ranked candidate changes. For each you can see the PR title, author and confidence, open the pull request in your provider, and view the diff inline to investigate without leaving StackSpend. If correlation hasn’t run yet, Find related changes triggers it on demand.

AI assessment

For a strong candidate, StackSpend runs an AI assessment over the actual diff and returns a structured, evidence-grounded read:

  • Likelihood the change contributed (changes ruled out are hidden);
  • The suspect lines from the diff, with why each matters;
  • How to verify — a concrete check you can run;
  • A suggested remediation and whether it’s a clean revert or a forward-fix.

The assessment is grounded only in what the diff shows — it does not speculate about traffic, prices, or changes it wasn’t given. It runs automatically for the most likely candidate; you never have to ask for it.

Note.Correlation is bounded by design: it only analyses material anomalies, only the most likely changes, and caps how much AI analysis runs — so it stays accurate and inexpensive rather than flagging every PR.
Source Control Correlation — StackSpend Docs — StackSpend Docs