auditing-warehouse-view-health

Audit PostHog materialized views for failures and unused compute waste.

713|118|Updated Aug 11, 2020
One-click install
npx skills add https://github.com/PostHog/posthog-foss --skill auditing-warehouse-view-health
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auditing-warehouse-view-health
Source: https://github.com/PostHog/posthog-foss/tree/main/products/data_warehouse/skills/auditing-warehouse-view-health
Command: npx skills add https://github.com/PostHog/posthog-foss --skill auditing-warehouse-view-health

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Materialized views in a PostHog data warehouse can silently fail due to HogQL errors or keep consuming storage and compute while nobody queries them. This Skill produces a project-wide health audit so you can find every failed materialization and flag stale, unused views in one pass.

Core Features & Use Cases

  • One-shot failure triage: Pulls all active materialized view failures via the data-health endpoint and surfaces each view's error, failure time, and URL.
  • Failure diagnosis: Distinguishes self-contained HogQL issues (syntax errors, missing table references, type mismatches) from source or sync problems, routing out-of-scope issues to the right audit.
  • Unused view detection: On request, lists materialized views that have not been queried lately so they can be unmaterialized to save compute.
  • Use Case: After a HogQL schema change, ask for a view health audit to confirm which dashboards backed by materialized views are now erroring and get a prioritized, human-readable report.

Quick Start

Ask the assistant to audit the health of my PostHog materialized views and tell me which ones are failing or wasting compute.

Frequently Asked Questions about auditing-warehouse-view-health

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find which PostHog materialized views are failing?

Run a view health audit that calls the data-health-issues endpoint and filters results to the materialized_view type. Each failing entry includes the view name, error message, failure timestamp, and a URL for investigation.

How do I find unused materialized views wasting compute?

Request a broader audit that uses view-list to check materialized views against their last-queried timestamps. Views that are materialized but not queried recently are surfaced as cleanup candidates you can unmaterialize.

Why is my PostHog materialized view failing?

Materialized view failures are usually self-contained HogQL problems such as syntax errors, missing table references, or type mismatches in the view definition. They are typically independent of source or sync health, and view-run-history shows the failure trail.

Does the view health audit cover source and sync issues?

No, source and external data sync issues are handled by the auditing-warehouse-source-health skill, even though they share the same data-health endpoint. Batch export destinations and transformations belong to other products and are routed rather than diagnosed.

Can the audit fix or unmaterialize broken views automatically?

No, the audit is strictly read-only and never calls destructive tools like view-unmaterialize or view-delete on its own. Any fix or unmaterialization requires explicit user confirmation after the report is presented.