authoring-log-alerts

Creates and validates low-noise log alerts for PostHog services using baseline statistics and simulation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Setting up log alerts by guessing thresholds leads to noisy alerts that fire constantly or silent alerts that never fire. This Skill turns alert authoring into a measurement problem: it triages services, characterizes their 7-day baseline, drafts thresholds from real percentiles, and back-tests each alert against history before shipping it.

Core Features & Use Cases

  • Service triage: Ranks the top 25 services by log volume and error rate to identify which ones are worth alerting on.
  • Baseline-driven thresholds: Pipes count-range data into a statistics script that computes p50/p95/p99 and suggests a threshold scaled to the alert window, with health flags for sparse, flat, or spiky baselines.
  • Simulation before shipping: Replays each draft alert against 7 days of history with a full state machine, iterating up to 3 rounds to land fire counts in the 0-3 per week band.
  • Use Case: A user asks to "set up alerts for my project." The Skill triages services, finds api-gateway has a spiky error baseline, drafts a 5-minute 2-of-3 alert at the suggested threshold, simulates it firing twice over 7 days, then creates the alert wired to a confirmed Slack channel.

Quick Start

Set up low-noise error alerts for the services in my PostHog project and suggest which ones are worth monitoring.

Frequently Asked Questions about authoring-log-alerts

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

FAQPage Schema
How do I set up log alerts in PostHog?

Start by triaging services with the logs-services tool to find candidates with non-trivial volume and non-zero error rates. Then characterize a 7-day baseline, draft a threshold from the baseline statistics, simulate the alert against history, and create it with a notification destination.

How do I choose a threshold for a log alert?

Pipe the logs-count-ranges response into the baseline_stats.py script, which computes p50, p95, p99, and max, then suggests a threshold scaled to your alert window. The suggestion is max(p99, median times 3, floor of 5) rate-scaled from the bucket width to the window.

How can I test a log alert before creating it?

Use the logs-alerts-simulate-create tool to replay a draft alert configuration against the last 7 days of history with the full state machine. Target a fire_count between 0 and 3 over that window, and iterate at most 3 simulation rounds per candidate.

When should I not create a log alert for a service?

Skip services with low volume (under roughly 1k logs per day), flat baselines where p95 approximates p50, or empty baselines with no signal. Also avoid below-threshold volume-floor alerts on services with quiet hours, since they will fire every night.

What notification destinations do PostHog log alerts support?

Log alerts support Slack (with workspace and channel IDs), generic webhooks via URL, and Microsoft Teams via webhook URL. Always confirm the channel or webhook with the user before attaching it, since an alert without a destination is silent.