sqlmesh-observability¶
Elementary-style data observability for SQLMesh projects.
It installs as a Python package next to SQLMesh, is enabled from config.py, and needs no changes
to SQLMesh itself.
Pre-alpha
Expect breaking changes before 1.0. Requires Python 3.9 or newer and a SQLMesh release with
the execution-observation API (added after v0.236.4).
Open the live demo report Get started
What it does¶
- Logs every run. Each plan and run writes its model runs and audit results to an
observabilityschema in your warehouse, keyed by model version. - Gates on anomalies.
volume_anomaly,freshness_anomaly, andcolumn_anomalyare SQLMesh audits that compute history from your data and can block a plan before promotion. - Watches passively. It records row counts, freshness lag, column null rates and means, and schema changes on every run, and scores them for anomalies when you read them.
- Reports.
sqlmesh-observe reportwrites an offline HTML dashboard of what is in prod, andsqlmesh-observe serveserves the same dashboard as a read-only web app. - Alerts.
sqlmesh-observe monitorsends one grouped message per model owner for new prod failures and anomalies, through your own notification target.
The demo¶
The demo report is rebuilt from the current code on every change to main.
scripts/build_demo.py runs a small DuckDB project through a short prod history:
- Fifteen days of orders and customers, all passing.
- Day 16 brings an order volume spike, 300 null statuses, and a jump in average amount. The
passive monitors flag all three as anomalies, and the non-blocking
volume_anomalyandnot_nullaudits fail. - A forward-only change adds a
channelcolumn to orders. The schema monitor records it. - A new
paymentsmodel fails its blockingnot_nullaudit, so prod is not promoted. The report still shows the failure, with sample rows.
raw.orders is declared as an external model feeding orders, which feeds daily_revenue and
payments, so the Lineage tab has a small graph to show.
The 1,500-model demo shows the report at scale: seeded data for 1,500 models across 15 schemas and 20 owners, with 90 days of history cut to the latest 30 intervals.
Quick start¶
pip install sqlmesh-observability
# config.py
from sqlmesh.core.config import Config
from sqlmesh_observability import install
config = install(Config(...), "warehouse", monitors={"volume": True, "schema": True})
sqlmesh plan # unchanged; the log is written as it runs
sqlmesh-observe report -o report.html # open the dashboard