dbt
dbt model cost, the model graph, and seven dbt cost rules. Works from job comments alone, or from a manifest upload or dbt Cloud sync. On every plan.
The dbt page (/dbt) shows what each dbt model costs to build and to test. It works on every plan, including the trial.
There are two ways SlashPeak reads dbt. Both are free on every plan.
| Option A: job comments | Option B: manifest or dbt Cloud | |
|---|---|---|
| Setup | None | Upload manifest.json, or connect dbt Cloud |
| Materialization | Guessed from the SQL statement type | Exact (table, view, incremental, snapshot) |
| Owner and tags | No | Yes, from dbt meta and tags |
| Model graph and inclusive cost | No | Yes |
| Findings | dbt test cost, dbt dev/CI target spend | All 7 dbt findings |
Option A — automatic, no setup
dbt writes a JSON comment and labels on each BigQuery job it runs. SlashPeak reads them on every scan. You get node ids, targets and a guessed materialization.
Option B — manifest or dbt Cloud
Open the Connections page and find the dbt card for your BigQuery connection. Pick dbt Core to upload a file, or dbt Cloud to sync.
dbt Core: upload manifest.json
- Run
dbt compileordbt buildin your project. - Upload
target/manifest.json(up to 100 MB). - Optional: add
run_results.jsontoo. It adds run times and full-refresh history. - Click Upload manifest.
Upload again after big changes to the project, so the graph stays current.
dbt Cloud: sync
- Enter your Access URL. Copy it from the browser address bar in dbt Cloud, for example
https://ab123.us1.dbt.com. SlashPeak keeps only the host. Leave it empty only if that address iscloud.getdbt.com. - Enter your dbt Cloud Account ID.
- Enter a service token with the Read-Only permission set. Create it in dbt Cloud under Account settings → Service tokens. Do not use Metadata Only: the sync needs the Admin API.
- Click Connect dbt Cloud.
If you want the optional CI trigger for AI DBA pull requests (below), give the token Job Admin instead. That permission can start a job.
If dbt Cloud says the token is not accepted (401), check the Access URL first. A token sent to the wrong host fails. If the token cannot read the account (403), make a new token with Read-Only.
SlashPeak syncs once a day. It reads the latest run's manifest.json and run_results.json. It never starts a dbt Cloud run, except the optional CI trigger for AI DBA pull requests (below).
The token is encrypted, the same way as the BigQuery key.
What we never store
- Compiled SQL from your models. Uploaded files are read in memory and thrown away.
- We keep only names, materialization, owners, tags, config and the dependency edges.
The dbt page
- Spend & activity: dbt job cost and runs over the selected window. Tabs: Runs & failures and Cost by node type. Breakdowns By materialization and By target (production vs dev/CI).
- Most expensive nodes: models, tests and snapshots ranked by cost, by bytes billed or by slot-hours. With Option B, each shows its inclusive cost: its own cost plus everything downstream that depends on it.
- Nodes: every dbt node seen in the window, most expensive first.
- Invocations: the most recent dbt runs.
Click a node to open /dbt/<node id>: its cost, runs, upstream and downstream models, and the open findings that touch it.
The Synced projects list on the Connections dbt card shows each project and when it last synced.
The seven dbt findings
| Finding | Needs |
|---|---|
| Expensive dbt tests | Option A |
| dbt dev / CI target spend | Option A |
| Unused dbt model | Option B |
| dbt full-refresh churn | Option B |
| dbt materialization mismatch | Option B |
| Unbounded dbt snapshot growth | Option B |
| dbt model pricing model | Option B |
See Findings for what each one means.
Fix dbt models with pull requests (Growth and up)
With the Cognis AI DBA, dbt findings become pull requests in your repo:
- Rule-based: set
cluster_by, setpartition_by, change materialization to a view, disable an unused model, addincremental_predicates, or send one model's queries to a reservation or to on-demand with asql_headerline (SET @@reservation). Each changes one key in the model'sconfig()block. - AI-written: add a partition filter, replace
SELECT *, limit expensive tests, fix an incremental model that keeps rebuilding.
A person always merges. SlashPeak never does.
Optional: SlashPeak can start a dbt Cloud CI job on each fix branch, so you get a build check before you merge. It runs only on the slashpeak/ai-dba/… branch, never on your default branch. Each run uses your dbt Cloud job minutes.
| Growth | Pro | Enterprise | |
|---|---|---|---|
| Fix pull requests open at once | 3 | 10 | 20 |
| GitHub repos | 2 | 10 | 25 |
| dbt Cloud CI runs per pull request | 1 + 1 re-run | 1 + 3 re-runs | 1 + 4 re-runs |
See GitHub pull requests.
If the graph is missing
Job comments alone do not build the graph. Upload a manifest.json or connect dbt Cloud.