Skip to content

feat(server): estimated Snowflake query cost per run, node and warehouse - #1461

Merged
kvlonge merged 3 commits into
mainfrom
feat/snowflake-resource-costs
Nov 14, 2026
Merged

kvlonge merged 3 commits into
mainfrom
feat/snowflake-resource-costs

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Why

Snowflake users want build cost per run, model and warehouse size without opening query history. Cost was collected after each build but kept nowhere the server or UI could read.

Changes

  • After a Snowflake build, append the run's estimated cost to an append-only _sqlbuild_resource_costs state table: a total row plus one row per resource and warehouse. The build re-reads up to three pending, partial or failed runs from the last 6 days and appends an attempt only when it improves. Failures warn; the build result is unchanged. USD only for a configured price.
  • Sync it to the control store and serve a target summary (by job, warehouse size, node), a node's cost per build, and a run's rows, from each run's newest attempt.
  • UI on Snowflake targets: Overview cost card, run Cost tab, "Est. cost" column and chart on a model's Runs tab.
  • Docs: where estimates appear and how refreshes work. DuckShop: edge_cases/orchestration/resource_cost_history.json.

Verification

  • Orchestration API test on SQLite and PostgreSQL; DuckDB-backed test of the append and refresh rules; state, UI and make check-ci.
  • Live Snowflake trial: two builds wrote model and total rows; the warehouse suspended on schedule afterwards. Throwaway schema dropped.

Price set:
Overview cost card in dollars
No price:
Overview cost card in credits with the price hint
Running run:
Run header showing cost pending

…he state schema

Not yet complete: no UI, server reads, docs or integration tests yet.
Rust unit tests for the refresh rules pass; clippy is clean.
@kvlonge kvlonge added the full-verify Run the full Verify matrix on this pull request label Nov 13, 2026
@kvlonge
kvlonge enabled auto-merge November 13, 2026 23:41
@kvlonge
kvlonge added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 16e22dc Nov 14, 2026
99 of 123 checks passed
@kvlonge
kvlonge deleted the feat/snowflake-resource-costs branch November 14, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-verify Run the full Verify matrix on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant