authoring-log-alerts
Fungsinya
Skill ini memilih layanan mana yang akan dipantau, menetapkan ambang peringatan dari pola log nyata, dan mengujinya sebelum Anda mengaktifkannya. Ditujukan untuk tim yang menginginkan peringatan yang berguna tanpa banjir kebisingan.
Kapan dipakai
- βSaat Anda ingin menyiapkan peringatan untuk log Anda dan tidak tahu harus mulai dari mana.
- βSaat Anda ingin memeriksa apakah sebuah layanan menghasilkan log yang layak diberi peringatan.
- βSaat Anda baru saja mengaktifkan peringatan log dan memerlukan kumpulan awal.
Link skill
https://github.com/PostHog/posthog/blob/master/products/logs/skills/authoring-log-alerts/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βSiapkan beberapa peringatan log yang berguna untuk layanan saya, sehingga saya hanya diberi tahu tentang masalah nyata.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill menemukan layanan paling sibuk beserta tingkat error-nya, melihat garis dasar normal, dan membuat draf ambang. Setelah itu, skill menguji ambang pada data masa lalu sebelum Anda memilih ke mana notifikasi dikirim.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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-listto inspect fire/resolve cadence andposthog:logs-alerts-partial-updateto 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_countis non-trivial (β₯ ~1k in 24h β quieter services produce too little signal to alert on).error_rateis 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
Pertanyaan umum
Seberapa sering sebuah peringatan sebaiknya aktif?
Tujuannya adalah agar setiap peringatan aktif sekitar 0 sampai 3 kali seminggu, sehingga peringatan tetap berguna.
Bisakah menyetel peringatan yang sudah ada?
Tidak. Menyesuaikan peringatan yang sudah ada adalah pekerjaan terpisah yang tidak dicakup skill ini.
Bisakah membantu saat insiden sedang berlangsung?
Tidak. Saat insiden, Anda sebaiknya langsung melihat log, bukan membuat peringatan.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 41k
- Peringkat
- #6888
- Lisensi
- β
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
depot-ci
41kMembantu agent Anda menyiapkan dan menjalankan alur kerja Depot CI, alternatif GitHub Actions, termasuk memigrasikan alur kerja yang ada dan membaca log eksekusi.
depot-container-builds
41kMembantu agent Anda membangun image Docker di builder jarak jauh Depot, termasuk image multi-platform, pengiriman ke registry, dan perbaikan kegagalan build.
depot-github-runners
41kMembantu agent Anda memindahkan job GitHub Actions ke runner yang dikelola Depot, memilih ukuran dan label runner, serta memecahkan masalah pengaturan runner.
editing-agents-md
41kMembantu agent Anda memutuskan apakah sebuah aturan layak masuk ke berkas AGENTS.md atau CLAUDE.md, dan menulisnya agar tetap dipatuhi tanpa membuat berkas membengkak.
Skill serupa
openclaw-update
394kMembantu agent Anda memperbarui OpenClaw Gateway yang sudah ada, dengan memilih metode pembaruan yang sesuai cara pemasangannya dan menjaga sesi Anda tetap berjalan.
diagnose-gateway
394kMembantu agent Anda mencari tahu mengapa OpenClaw Gateway gagal dengan memeriksa pengaturan, channel, dan port tanpa mengubah apa pun.
crabbox-apps
394kMembantu agent Anda membuka dan menjalankan aplikasi di mesin cloud sementara, lalu menampilkan tampilannya di panel samping chat Anda.