auditing-endpoints

Audits PostHog endpoints for staleness, failed materialisations, and unused materialised versions.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Over time, PostHog projects accumulate endpoints that are never called, materialisations that silently fail, and old materialised versions that waste storage and compute. This Skill performs a read-only, project-wide audit that surfaces exactly what can be cleaned up, grouped and prioritised by issue type.

Core Features & Use Cases

  • Inventory and usage cross-referencing: Queries system.data_modeling_endpoints and query_log via HogQL to find endpoints that were never called or have gone stale (no calls in 30+ days).
  • Materialisation health checks: Detects failing materialisations via endpoint-materialization-status and unused materialised versions via per-version last_executed_at from endpoint-versions.
  • Prioritised, read-only report: Produces a grouped report (failing materialisations, never called, unused versions, stale) with recommended actions, and never modifies anything without explicit user confirmation.
  • Use Case: You inherit a PostHog project with dozens of endpoints and ask for an audit; the Skill reports one failing materialisation, three never-called endpoints, and one unused materialised version, then offers to hand off the failure to a diagnosis flow or clean up with your confirmation.

Quick Start

Ask the agent to audit my PostHog endpoints and tell me which ones I can clean up.

Frequently Asked Questions about auditing-endpoints

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

FAQPage Schema
How do I find unused endpoints in my PostHog project?

Run an endpoint audit that cross-references system.data_modeling_endpoints with query_log via HogQL. Endpoints present in metadata but absent from query_log were never called via personal API key, and those whose last call is over 30 days old are flagged as stale.

How do I check if a PostHog endpoint materialisation is failing?

Use the endpoint-materialization-status tool for each materialised endpoint, since failure state is not stored in the system tables. A status of Failed with an error message indicates an active failure that should be handed off to a performance diagnosis flow.

Does the endpoint audit modify or delete my endpoints?

No, the audit is strictly read-only and only produces a prioritised report. Disabling endpoints or unmaterialising versions via endpoint-update happens only after you explicitly confirm the recommended action.

Why does an actively used endpoint show as never called in the audit?

Usage counts only personal-API-key calls recorded in query_log. Endpoints exercised solely from the Playground tab or the app appear unused, and per-version last_executed_at is sparse, so always confirm with the user before disabling anything.

What is the cheapest way to reduce PostHog materialisation costs?

Unmaterialise versions that are no longer executed by calling endpoint-update with is_materialized set to false, rather than deleting the endpoint. The audit identifies unused materialised versions by checking each version's last_executed_at via endpoint-versions.