Skip to main content

Run history for dbt. Every invocation recorded, nothing overwritten.

Project description

dbt-logbook

Run history for dbt. Every invocation recorded, nothing overwritten.

dbt writes run_results.json and overwrites it on the next run. dbt-logbook keeps every run in a local SQLite store and gives you the views that history makes possible - with zero configuration and zero changes to your dbt project.

Per-model duration across runs, with a visible regression

What you get

  • Run timeline: every recorded invocation, status at a glance, failures inline
  • Per-model history: duration sparkline across runs - see the regression the moment it starts, and the failed runs marked on the line
  • What changed between two runs: checksum-based diff (added / removed / modified models), powered by dbt's own per-node checksums
  • Lineage: clickable DAG from your manifest, tests hidden by default

Quickstart

uvx dbt-logbook demo          # populated playground, no dbt project needed

In a real dbt project (any adapter - DuckDB, Snowflake, SQL Server, Postgres, ...):

cd your-dbt-project
uvx dbt-logbook ui            # instant read-only UI over the artifacts dbt already wrote

History accrues from the capture wrapper - change one line in your cron/CI:

dbt-logbook exec -- dbt build     # runs dbt untouched, records the run
                                  # exit code passes through exactly

Or ingest artifacts from anywhere (for example, downloaded CI artifacts):

dbt-logbook import path/to/artifacts --env prod

Ask your agent about your runs (MCP)

The history store is exposed as an MCP server - the cross-run questions that current-state tools structurally can't answer, because dbt overwrites its artifacts:

claude mcp add dbt-logbook -- uvx dbt-logbook mcp     # from your dbt project dir

Then ask: "what broke last night?", "which models got slower this week?", "which tests are flaky?", "what changed between the last two runs?", "what would state:modified rebuild?". Full tool list and REST equivalents: docs/api-contract.md.

Run it as the platform (scheduler + alerts)

One process replaces cron + hope. Drop a dbt-logbook.yml in the project root:

schedules:
  hourly:
    cron: "0 * * * *"
    command: dbt build
    retries: 2
notify:
  slack_webhook: https://hooks.slack.com/services/...   # or teams_webhook
  on: [failure, recovery]
dbt-logbook serve

You get: cron scheduling with retries, every run recorded, a Slack/Teams ping on new failures and on recovery, auto-import of runs that happen outside the scheduler (a target/ watcher), and the UI - all one process, localhost only.

Keep it alive the boring way: docker run --restart unless-stopped ... or a systemd unit with Restart=on-failure.

Slim CI without artifact plumbing

The store already holds every environment's last-good manifest - serve it to CI instead of copying manifest.json to S3:

# in CI, against a reachable dbt-logbook serve --host ... --token ...
- run: |
    curl -sf -H "Authorization: Bearer $DBT_LOGBOOK_TOKEN" \
      "$LOGBOOK_URL/api/state/prod/manifest.json" -o ci-state/manifest.json
    dbt build --select state:modified --defer --state ci-state

Locally the same thing is one command: dbt-logbook state --env prod --out ci-state. Binding beyond localhost requires a token; /api/* then demands Authorization: Bearer <token>.

How it works

dbt-logbook reads only dbt's stable surfaces - the CLI and the artifact files (manifest.json, run_results.json) - and never imports dbt internals. That is why it works unchanged across dbt Core 1.7 through 2.0 (tested against golden artifacts of 1.7, 1.8, 1.10, 1.11, and 2.0-alpha), and why it needs no dbt installation of its own.

Every run's artifacts land in .dbtlogbook/history.db (SQLite; add .dbtlogbook/ to your project's .gitignore). Manifests are content-hashed and gzipped, so the store stays small. Failed dbt runs are captured too - those are the ones you'll want history for.

Platform notes

  • macOS and Linux. On Windows, ui and import are untested but should work (pure Python); exec is unsupported for now (POSIX signal semantics).
  • The UI binds to localhost only.

Health screen

#/health in the UI: duration regressions (latest vs median baseline), flaky nodes (status flips across recent runs), and source freshness over time (from dbt source freshness snapshots the watcher or wrapper picks up). Generated dbt docs output is served at /docs-site/ when present.

Health: regressions, flaky nodes, freshness over time

Roadmap

  • Windows exec support, UI framework rebuild: see TODOS.md - both deferred until demand shows up in issues.

License: Apache-2.0. Not affiliated with dbt Labs; "dbt" is a trademark of dbt Labs, Inc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbt_logbook-0.5.0.tar.gz (846.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbt_logbook-0.5.0-py3-none-any.whl (247.1 kB view details)

Uploaded Python 3

File details

Details for the file dbt_logbook-0.5.0.tar.gz.

File metadata

  • Download URL: dbt_logbook-0.5.0.tar.gz
  • Upload date:
  • Size: 846.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dbt_logbook-0.5.0.tar.gz
Algorithm Hash digest
SHA256 b24d6cad320c565a49055d1e9d40e7c7a738d16c9b5efe68d0ed13c6cfa60d89
MD5 7486dc868888ad2a04d5e7f8222417a6
BLAKE2b-256 b363065ace78b85a56c598b999a950491e0a03b94c3411affb0c5aab6f5188c4

See more details on using hashes here.

File details

Details for the file dbt_logbook-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: dbt_logbook-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 247.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dbt_logbook-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f26f52f9a0df426aea2e770d6bb47782dce5acef07181efa8533ff95fe7d0ee9
MD5 f1314f8f7ddb1c9378fa7c226783e3a7
BLAKE2b-256 941a2bda6bcd39ed579fc7ad8c3bb650afbf9e7af472106844ad79d987bb4cfb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page