Zum Inhalt springen
Skillpedia
Deployment & Cloud (DevOps)41k · #6888

authoring-log-alerts

Was er macht

Dieser Skill wählt die zu überwachenden Dienste aus, setzt Warnschwellen anhand echter Log-Muster und testet sie, bevor du sie einschaltest. Er richtet sich an Teams, die nützliche Warnungen ohne Lärm wollen.

Wann du ihn nutzt

  • ✓Wenn du Warnungen für deine Logs einrichten willst und nicht weißt, wo du anfangen sollst.
  • ✓Wenn du prüfen willst, ob ein Dienst Logs erzeugt, die eine Warnung wert sind.
  • ✓Wenn du gerade Log-Warnungen eingeschaltet hast und ein Startset brauchst.

Link zum Skill

https://github.com/PostHog/posthog/blob/master/products/logs/skills/authoring-log-alerts/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/PostHog/posthog/blob/master/products/logs/skills/authoring-log-alerts/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Richte ein paar nützliche Log-Warnungen für meine Dienste ein, damit ich nur von echten Problemen höre.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Skill findet die aktivsten Dienste und ihre Fehlerraten, betrachtet eine normale Grundlinie und entwirft Schwellen. Danach testet er die Schwellen an vergangenen Daten, bevor du wählst, wohin die Benachrichtigungen gehen.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Authoring log alerts

Authoring an alert is a measurement problem, not a guessing problem. You are not trying to be exhaustive — you are trying to land thresholds that fire 0–3 times per week on real production patterns, on services that matter.

When to use this skill

  • The user asks to "set up alerts" / "suggest alerts" for their project.
  • The user wants to evaluate whether a service is producing alertable signal.
  • The user has just enabled log alerting and wants a starter set.

When not to use this skill

  • Tuning an alert that already exists — that's a different job (use posthog:logs-alerts-events-list to inspect fire/resolve cadence and posthog:logs-alerts-partial-update to adjust).
  • Investigating an active incident — pull rows with posthog:query-logs, don't author an alert mid-incident.

Tools

Tool Job Where it fits
posthog:logs-services Top-25 services in window with log_count, error_count, error_rate, sparkline. Step 1 — triage.
posthog:logs-attributes-list / posthog:logs-attribute-values-list Discover keys/values for narrower filters. Step 2, optional.
posthog:logs-count-ranges Adaptive time-bucketed counts for a filter. Step 3 — baseline.
posthog:logs-alerts-simulate-create Replay a draft config against -7d history with full state machine. Step 4 — validate.
posthog:logs-alerts-create Persist the alert. Step 5 — ship.
posthog:logs-alerts-destinations-create Wire the alert to Slack, webhook, or Microsoft Teams. Step 5: ship.

Do not call posthog:query-logs during authoring. You need distributions, not rows. Reserve posthog:query-logs for the very end if the user asks "show me a sample of what would have fired" — limit: 10 is plenty.

Workflow

1. Triage — pick candidate services

Call posthog:logs-services for the last 24h with no filters. The response is capped at 25 services and includes a sparkline, so it is small and bounded.

A service is a candidate when both are true:

  • log_count is non-trivial (≥ ~1k in 24h — quieter services produce too little signal to alert on).
  • error_rate is non-zero, or the user has named the service explicitly.

Skip services with high volume but error_rate == 0 unless the user wants a volume-shape alert (e.g. "warn me if api-gateway suddenly stops producing logs"). Volume-floor alerts use threshold_operator: below and need different reasoning — see references/volume-floor-alerts.md.

If the user names a service, treat it as a candidate even without error signal.

2. (Optional) Narrow the filter

If a service has many error sub-types, an alert on "all errors" is usually too broad. Use posthog:logs-attributes-list (try attribute_type: log) and posthog:logs-attribute-values-list to find a discriminator — common ones are http.status_code, error.type, k8s.container.name. Add the narrowing filter to your draft.

Keep it simple: one severity filter + one or two attribute filters is plenty. Multi-clause filters are harder to reason about and rarely improve precision.

3. Baseline — characterise the candidate over 7 days

Call posthog:logs-count-ranges with the candidate's filters, dateRange: { date_from: "-7d" }, and targetBuckets: 24 (one bucket ≈ 7h). The response gives you bucket counts.

Do not eyeball the percentiles or scale the threshold to the alert window manually. Pipe the count-ranges response into the helper script:

echo '<count-ranges JSON>' | python3 scripts/baseline_stats.py --window-minutes 5

The script returns:

{
  "n_buckets": 12,
  "bucket_minutes": 420.0,
  "alert_window_minutes": 5,
  "stats": { "p50": 12.0, "p95": 71.25, "p99": 126.25, "max": 140 },
  "suggested_thresho
Häufige Fragen

Wie oft sollte eine Warnung auslösen?

Ziel ist, dass jede Warnung etwa 0 bis 3 Mal pro Woche auslöst, damit die Warnungen nützlich bleiben.

Kann er eine bestehende Warnung anpassen?

Nein. Eine bestehende Warnung anzupassen ist eine eigene Aufgabe, die dieser Skill nicht abdeckt.

Kann er während eines aktiven Vorfalls helfen?

Nein. Während eines Vorfalls solltest du die Logs direkt ansehen, statt Warnungen anzulegen.

Details

Originalbeschreibung des Autors

Author useful, low-noise log alerts on services in a PostHog project. Use when the user asks to set up alerts for their logs, suggest alerts they should add, or evaluate whether a service is worth monitoring. Covers service triage, baseline characterisation, threshold drafting, back-testing via simulate, and shipping with a notification destination.

repo: PostHog/posthog

Beliebtheit

GitHub-Sterne
41k
Platz im Ranking
#6888
Lizenz
—
Aktualisiert
2.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills