Skip to main content

Read-only BigQuery cost-audit tool — single-user, gcloud ADC only, no GCS / no GitHub / no dbt installation.

Project description

governor-audit

Read-only BigQuery cost-audit tool for single-user production audits.

Posture: Single-user. gcloud ADC only. No GCS, no GitHub, no service-account JSON, no dbt installation, no shadow validation. The only thing it talks to over the network is BigQuery — and only to query INFORMATION_SCHEMA.JOBS_BY_PROJECT.

When to use this vs. the other governor packages

  • governor-audit (this package): you have read access to a prod BigQuery project. You want a fast cost audit + detection findings without touching the dbt source code, running dbt, or setting up cloud infrastructure.
  • governor-cli: you have the dbt project source on your machine and want to run dbt + propose fixes locally.
  • governor-web: you operate the platform; you want shared infrastructure (GCS-backed manifests, GitHub PRs, scheduled syncs) for a team.

What you get

  • Dashboard — Total / Build / Consumption / Flagged spend KPI cards, top-20 spenders bar chart, paginated cost-drivers table with click-to-sort columns and a per-row issue count.
  • Detection engine — every enabled rule from governor_core.opportunities.rules (partition_pruning, shuffle_spill, slot_contention, join_explosion, dead_cte, dead_column, dead_window_expression, redundant_order_by, unused_aggregation_output, unused_join) runs on each cached job; opportunities feed the Active Issues pane.
  • Job detail — full SQL viewer with expand / copy buttons, metadata panes, and the list of detection-rule findings for that job.
  • Settings — Account (gcloud principal + ADC probe), Appearance (light / dark / system), AI / LLM (provider, model, params — reviewer code lands in v0.0.2), Detection Rules (per-rule enable/disable).
  • Reset cache — wipe everything INFORMATION_SCHEMA collected without losing your config.

Quickstart

gcloud auth application-default login
uv tool install governor-audit
governor-audit init --project prod-warehouse-123 --region us
governor-audit scan --days 30
governor-audit start
# open http://localhost:8765

The web UI exposes the same actions as the CLI plus the dashboard / settings views. After the first init you can do everything from the browser.

See the spec's quickstart for the full first-audit walkthrough.

Architecture

  • Storage: SQLite at ~/.governor-audit/state.db via governor_core.db.sqlite_compat.
  • Auth: gcloud Application Default Credentials only — google.auth.default(). No service-account JSON. No browser OAuth.
  • Workload classification: manifest-free heuristic — dbt-originated CTAS / MERGE / INSERT / UPDATE / DELETE → build; non-dbt SELECT → consumption; ambiguous → other. Driven by the /* {"app": "dbt" comment-prefix the dbt-bigquery adapter prepends.
  • Loopback only: the FastAPI app rejects any request whose Host: header isn't a localhost variant. Not a public service.

See spec 141 for the complete spec set:

Versioning

governor-audit ships on its own version track, decoupled from the cloud bundle (governor-core / governor-web / governor-cli / governor-bq). Audit v0.0.1 and cloud v0.7.x coexist. See scripts/release-audit.sh for the release flow.

License

MIT.

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

governor_audit-0.0.2.tar.gz (99.2 kB view details)

Uploaded Source

Built Distribution

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

governor_audit-0.0.2-py3-none-any.whl (126.6 kB view details)

Uploaded Python 3

File details

Details for the file governor_audit-0.0.2.tar.gz.

File metadata

  • Download URL: governor_audit-0.0.2.tar.gz
  • Upload date:
  • Size: 99.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for governor_audit-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c8678a662f0b708b8ace1d54ac95b6ce22b06f9c3cda1b32b01771c70b74d409
MD5 aafd643e6efbbff3ad09d27daff65a37
BLAKE2b-256 a69033e8d0d6122a95b9c82a8a6217fa16f864acebc5b98cee5e2a60a0f03348

See more details on using hashes here.

File details

Details for the file governor_audit-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: governor_audit-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 126.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for governor_audit-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1f13252e588e36943a4afc3347634914a8d671e7ca0326037ae39e3bcd4f6dca
MD5 32dc46df8dfc38628bcc45a0836231af
BLAKE2b-256 60f853791266495a16307dae74e6057f9f2209f1147163c39ad67b8cadd70b7d

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