investigating-logs

Investigate PostHog log streams to verify deployments, explain error spikes, and triage incidents.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Investigating production logs manually means scrolling through millions of raw lines or writing fragile SQL queries that hit read-byte caps. This Skill routes PostHog's logs MCP tools so investigations start from compressed summaries (pattern mining, before/after diffs, bucketed counts) instead of raw rows, letting you answer "did my deploy break anything?" or "why are errors up?" quickly and cheaply.

Core Features & Use Cases

  • Post-deploy verification: Diff log patterns between windows before and after a change to detect new error templates, rate shifts, and volume discontinuities.
  • Spike explanation and incident triage: Localize a spike with bucketed counts, then run a single pattern diff against a baseline window to surface suspects.
  • Stream orientation: Mine message templates from an unfamiliar service to understand what it is logging, including error share per template.
  • Use Case: After deploying a new release, ask whether anything broke. The Skill checks service health, diffs error patterns against the pre-deploy baseline, verifies volume continuity, and returns a verdict with suspect templates and sample raw lines.

Quick Start

Ask the AI to check the logs and verify whether your latest deployment to a specific service broke anything.

Frequently Asked Questions about investigating-logs

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

FAQPage Schema
How do I check if my deployment broke something in the logs?

Pin down the change time and affected service, then run a pattern diff comparing the window after the change against a comparable baseline before it. New error templates, large rate-ratio shifts, or volume discontinuities indicate a regression.

How do I find the root cause of an error spike in PostHog logs?

Localize the spike with bucketed count queries, recursing into the densest time buckets. Then run a single pattern diff of the spike window against the window just before it; the top new and rate-shifted templates are the explanation.

Should I query the PostHog logs table with SQL for investigations?

No. Hand-written HogQL over the logs table routinely hits read-byte caps and re-derives what the dedicated log tools do in one cheap call. Reserve SQL for rare cases of joining log-derived facts with non-log data.

Why does a severity filter return zero rows in PostHog logs?

The severityLevels filter matches six canonical lowercase buckets against severity_text exactly. If you get zero rows, inspect the stored values with the attribute-values tool for the severity_text key to see what your services actually emit.

What are the limitations of log pattern mining in PostHog?

Pattern counts are sampled estimates, so templates rarer than roughly 1 in 10,000 rows can be invisible. Also, a tiny or empty baseline window makes everything look new in a diff, so check the baseline total count before trusting results.

When should I not use log investigation for a PostHog question?

Use a different approach for creating or tuning log alerts, and for analytics over product events, persons, or insights. Log investigation is for verifying health, explaining spikes, and triaging incidents in log streams.