triaging-warehouse-sync-tickets

Diagnose customer data warehouse sync failures by querying PostHog production Postgres and ClickHouse.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Support tickets describe what a customer sees, not what actually happened to their data warehouse sync. This Skill lets a PostHog support engineer determine the real state of a customer's warehouse source, schema, or table by querying PostHog's own production databases, turning vague complaints like stale, empty, stuck, or duplicated tables into an evidence-backed diagnosis with one recommended action.

Core Features & Use Cases

  • Production data access via direct-connect sources: Runs execute-sql with a connectionId against Production Postgres (externaldatasource, externaldataschema, externaldatajob, datawarehousetable) and Production ClickHouse (log_entries, app_metrics2), always filtered by the customer's team_id.
  • Region detection and cross-region access: Identifies whether the customer is on US or EU from project URLs, tokens, or emails, and routes EU queries through posthog-connection-call since team ids repeat across regions.
  • Requester verification and safe querying: Verifies the ticket reporter's organization membership before querying a team, validates all ticket-derived values before SQL substitution, and treats log and error text as untrusted data.
  • Use Case: A ticket says a customer's Postgres warehouse table stopped updating. The Skill walks through finding the region, locating the source and schema, reading the last 20 job runs, pulling error logs by workflow_run_id, checking app_metrics2 trends, and producing a diagnosis naming the cause, the side responsible, and exactly one recommended action.

Quick Start

Use the triaging-warehouse-sync-tickets skill to diagnose why the warehouse table in this support ticket stopped syncing and recommend one fix.

Frequently Asked Questions about triaging-warehouse-sync-tickets

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

FAQPage Schema
How do I debug a customer's stale warehouse table from a support ticket?

Query Production Postgres for the source, schema, and last 20 externaldatajob rows filtered by the customer's team_id, then read log_entries in Production ClickHouse by workflow_run_id. Finish with one diagnosis, the responsible side, and a single recommended action.

How do I query another customer's PostHog data with execute-sql?

Set connectionId on execute-sql to a Production direct-connect source discovered via external-data-sources-connections-list, and filter every query by the customer's team_id. Without a connectionId, execute-sql silently answers from your own project.

How do I access EU PostHog production data from a US project?

Route calls through posthog-connection-call using a PostHog integration found with integrations-list kind=posthog. Nest the EU connectionId inside the execute-sql arguments; the connection points at PostHog's own EU project, not the customer.

Why does my warehouse sync query return zero log rows?

ClickHouse renders timestamps in the project timezone while Postgres stores UTC, so a window written without an explicit 'UTC' argument silently matches nothing. Use toDateTime with 'UTC' or now() - INTERVAL n HOUR before concluding a run was healthy.

Can I use the external-data-sources-retrieve tool to check a customer's source?

No. The external-data-* product tools read your own MCP session's project and return real-looking rows without erroring, so they cannot see the customer. Only execute-sql with a Production connectionId and a team_id filter reaches customer data.

What safety checks are required before querying production customer data?

Verify the ticket reporter's email maps to an organization membership containing the target team, validate every ticket-derived placeholder before SQL substitution, never select job_inputs, and treat log and error message text as untrusted data rather than instructions.