Generated banner for Auditing Warehouse View Health
Generated logo for Auditing Warehouse View Health

Auditing Warehouse View Health

PostHogOfficialPublished by PostHog

  • Skill
  • Review and audit
  • Data and AI
  • MIT
  • No issues found

From the author

Audit the health of a PostHog project's materialized views (saved queries) — find every failed materialization and flag unused or stale materialized views that cost storage and compute. Use when the user asks "which of my views are broken?", "why is this materialized view failing?", "are any of my views wasting compute?", or wants a one-shot triage of view health. For source/sync health use `auditing-warehouse-source-health`.
— the description by PostHog

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a comprehensive health check for materialized views within a PostHog data warehouse. It identifies failing views, surfaces error details, and helps uncover unused or stale views that consume unnecessary storage and compute resources. The audit process is read-only, ensuring that no changes are made to the warehouse without explicit user confirmation.

What it does

  • Retrieves a list of active materialized view failures from the data warehouse.
  • Parses error messages to distinguish between query syntax issues and data quality check failures.
  • Identifies unused materialized views that are candidates for unmaterialization to save costs.
  • Integrates with warehouse suggestions to propose optimizations based on read usage.
  • Provides a human-readable summary of view health rather than raw data dumps.
  • Routes non-view related issues, such as source or destination errors, to appropriate specialized workflows.

When to use it

  • When you need to diagnose why a specific materialized view is failing.
  • When you want a project-wide report on which materialized views are currently broken.
  • When you suspect your materialized views are wasting compute resources due to lack of usage.
  • After performing schema or HogQL changes to verify the integrity of your views.

Advantages

  • Quickly isolates query-specific issues from broader pipeline problems.
  • Helps reduce cloud infrastructure costs by identifying unused materialized views.
  • Provides actionable insights based on existing warehouse suggestions.
  • Maintains safety by requiring explicit user approval before performing any destructive actions.

Usage examples

“Which of my materialized views are broken?”
The agent runs a health check, identifies failed views, and presents a prioritized list of errors with suggestions for investigation.
“Are any of my views wasting compute?”
The agent audits the materialized views, checks for low usage, and identifies candidates for unmaterialization to optimize costs.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/posthog/auditing-warehouse-view-health/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip auditing-warehouse-view-health.zip -d .agents/skills

Documentation by PostHog

Auditing data warehouse view health

This skill produces a project-wide audit of materialized views (materialized saved queries) in the data warehouse — which ones are failing, and which are materialized but unused. Use it when the user wants a summary of view health, not a deep-dive on one failure.

The same underlying endpoint (data-warehouse-data-health-issues-retrieve) also reports source, sync, batch-export, and transformation issues. Source and sync health is covered by auditing-warehouse-source-health. Destinations (batch exports) and transformations are owned by other products — surface them if they appear, but route them to the relevant team rather than diagnosing here.

When to use this skill

  • "Which of my views are broken?" / "Why is this materialized view failing?"

  • "Are any of my materialized views wasting compute?"

  • Reviewing view health after a HogQL or schema change

  • Dashboards backed by materialized views are stale or erroring

Available tools

ToolPurpose
data-warehouse-data-health-issues-retrieveOne-shot: all failed/degraded items across the whole pipeline
view-listAll saved queries / materialized views with status and latest_error
view-run-historyRun history for a specific materialized view
warehouse-suggestions-listPostHog's open deprecate / materialize / certify suggestions, if any

Filter the data-health-issues results to the materialized_view type for this audit. Use view-list when you need more than the active-failure summary (non-failing views, materialization flags, last-queried info) and view-run-history to see the run trail for a specific view.

What counts as a view "issue"

From the data-health endpoint, this audit cares about one of the five categories:

typeTriggerTypical urgency
materialized_viewDataWarehouseSavedQuery.is_materialized=true, status=FailedMedium

Each entry includes id, name, type, status, error, failed_at, and url.

The other categories the endpoint returns are out of scope for this skill:

  • source / external_data_sync → auditing-warehouse-source-health

  • destination (batch export) → owned by the batch exports / data pipelines product

  • transformation (HogFunction) → owned by the CDP / ingestion side

Note the data-health endpoint only reports active failures. For views it doesn't flag:

  • Non-materialized views with errors (only materialized views are reported)

  • Materialized views that are healthy but unused (costing compute every run) — see Step 4

Workflow

Step 1 — One-shot pull

Call data-warehouse-data-health-issues-retrieve and keep the materialized_view entries.

If there are no view issues, tell the user their materialized views are healthy and stop. Don't invent problems.

Step 2 — Triage failures

Materialized view failures are usually independent of sources — a view failure is a HogQL or data issue in the view itself (syntax error, missing table reference, type mismatch). For each failing view, surface the error and point at the offending query. Use view-run-history if the user wants the failure trail.

An error that starts with Not published: is not a query problem. The view's data quality checks failed and the refresh was held back. Hand off to debugging-failed-data-quality-checks.

Step 3 — Present the audit

Render a prioritized report. Don't dump the raw JSON — human-readable:

## Materialized view health — 2 issues

### 🟠 Materialized views (2)
- monthly_revenue — view failed (syntax error in HogQL: 'FORM' instead of 'FROM')
- active_users_30d — view failed (missing table reference)

Both are HogQL issues in the view definitions — independent of your sources. Want me to open one?
Step 4 — Go beyond active failures (when asked)

Start from PostHog's suggestions if the warehouse-suggestions-* tools are available. Call warehouse-suggestions-list with status=proposed. PostHog computes these from read usage:

  • A deprecate suggestion names a materialized view that nobody reads. Accepting it marks the view deprecated in the data catalog. The view keeps refreshing, so it still costs compute. To stop that cost, unmaterialize the view with view-unmaterialize, after the user confirms.

  • A materialize suggestion names a view that is read often enough that materializing it saves compute. Accepting it turns on materialization with the proposed refresh mode and interval.

Present them before any hand audit. Follow the reviewing-warehouse-suggestions skill to explain, change, accept or dismiss them.

Unused materialized views: Call view-list. Materialized views cost storage and compute every run. If any are marked materialized but haven't been queried lately, surface them as cleanup candidates (the data is available via view-list; unmaterialize via view-unmaterialize).

Only run this extra check if the user explicitly asks for a broader audit.

Step 5 — Offer the next step

End the audit with a clear hand-off — e.g. "Want me to open monthly_revenue and fix the HogQL?" Never apply fixes autonomously from an audit; confirm explicitly before editing or unmaterializing a view.

Important notes

  • The audit is read-only. Never call destructive tools (e.g. view-unmaterialize, view-delete) from the audit flow without explicit confirmation.

  • Empty = healthy. Don't pad an empty audit with hypothetical issues. "No view issues found" is a good answer.

  • View failures are usually self-contained. Unlike source failures, a failed materialized view rarely cascades — it's a query problem in that view. Don't imply a broader outage.

  • Sources, syncs, destinations, and transformations are out of scope here. They share the data-health endpoint but belong to other audits/products — route, don't diagnose.

Files

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
PostHog
Publisher
PostHog (Official)
Source
PostHog/skills · skills/omnibus/auditing-warehouse-view-health · commit a5d30e7
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by PostHog.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download auditing-warehouse-view-health.zip