AGENT SKILL

observability-setup

Hub-and-spoke pipeline for installing the logs + metrics + traces triad on an existing service. Decomposes into 5 phases — scale/stack intake, code-side instrumentation, scrape+ship wiring, dashboard import, alert rules. Pure-click except for env-specific values (endpoints, tokens). Reuses `_blocks/obs-structured-logs.md`, `_blocks/obs-metrics.md`, `_blocks/obs-traces.md`, `_primitives/metrics-scrape.sh`, `_primitives/log-ship.sh`.

License 许可
Apache-2.0
最近更新
2026-10-11
Stars
★ 7
Forks
8

01 前言 Front Matter

name
observability-setup
description
Hub-and-spoke pipeline for installing the logs + metrics + traces triad on an existing service. Decomposes into 5 phases — scale/stack intake, code-side instrumentation, scrape+ship wiring, dashboard import, alert rules. Pure-click except for env-specific values (endpoints, tokens). Reuses `_blocks/obs-structured-logs.md`, `_blocks/obs-metrics.md`, `_blocks/obs-traces.md`, `_primitives/metrics-scrape.sh`, `_primitives/log-ship.sh`.
argument-hint
<service-or-repo-name>

02 资源文件 5

03 SKILL.md 正文

Observability-Setup — 5-Phase Pipeline (index)

When to use

  • Installing the logs + metrics + traces triad on an existing service for the first time.
  • Wiring Prometheus scraping, OpenTelemetry traces, and Grafana dashboards in one pipeline.
  • Adding alert rules to an already-instrumented service that lacks alerting.

See _blocks/pipeline-5phase-template.md for the 5-phase wizard contract and _blocks/rule-pure-click-contract.md for the AskUserQuestion rule. Skill-specific phase tables are inline below.

You are installing observability on an existing service or repo. The user tells you which service. You walk five phases, each with an AskUserQuestion click-batch. Every durable decision lands in a named file inside the target repo (observability.md, prometheus.yml, otel-collector.yaml, Grafana dashboard JSON, Alertmanager rules).

This SKILL.md is the INDEX. Each phase lives in its own file and runs in order. Never skip a phase — skipping Phase 4 gives you metrics with no dashboards; skipping Phase 5 gives you dashboards nobody watches.


Pipeline overview (5 phases + final report)

Phase File Purpose AskUserQuestion
1 phase-1-intake.md Scale / stack / log target click-batch 1× (3 questions)
2 phase-2-instrument.md Code-side SDK + config diff 1×
3 phase-3-scrape-ship.md Metrics scrape + log forward wiring 1×
4 phase-4-dashboards.md RED + USE + per-service dashboards 1×
5 phase-5-alerts.md Error rate / p99 latency / saturation 1×

Minimum AskUserQuestion count: 5. (Phase 1 bundles three related questions into one AskUserQuestion call with multiSelect per question, per native protocol.)


Variables the pipeline produces

Name Set in Meaning
SERVICE argument Service/repo name the user invokes the skill with
SCALE Phase 1 single-host / small-cluster / prod
STACK Phase 1 prom-grafana / otel-vendor / better-stack / custom
LOG_TARGET Phase 1 stdout-only / file / ship-loki / ship-datadog / ship-http
LANGUAGES Phase 2 Subset of {rust, go, python, node, swift} — SDKs to wire
SCRAPE_CFG Phase 3 prometheus.yml / otel-collector.yaml path
SHIP_CMD Phase 3 log-ship.sh invocation for the service
DASHBOARDS Phase 4 List of imported / generated dashboard slugs
ALERTS Phase 5 List of alert rule names

Final report (emit after Phase 5)

=== OBSERVABILITY-SETUP REPORT ===
Service:       <SERVICE>
Scale:         <SCALE>   Stack: <STACK>   Logs: <LOG_TARGET>
Instrumented:  <LANGUAGES>
Scrape cfg:    <SCRAPE_CFG>
Ship cmd:      <SHIP_CMD>
Dashboards:    <DASHBOARDS>
Alerts:        <ALERTS>
Next action:   commit + deploy + watch first 30 min of traffic

Rules (apply throughout)

  • Pure-click contract. Only values that must be typed are endpoint URLs, API keys (via env, never a prompt), and the service name (intake argument).
  • NO HALLUCINATION (RULE 0.4). Never invent Grafana dashboard IDs. If the user wants a dashboard, either generate the JSON from _blocks/obs-metrics.md naming conventions or link to the official exporter README. Dashboard IDs from grafana.com/dashboards/ MUST be verified via WebFetch in-session.
  • Reuse over rewrite. Phase 2 always cites _blocks/obs-structured-logs.md, _blocks/obs-metrics.md, _blocks/obs-traces.md. Phase 3 invokes _primitives/metrics-scrape.sh and _primitives/log-ship.sh — do not re-implement their logic inline.
  • Secrets via env (RULE 0.8). API keys for Datadog, Better Stack, Grafana Cloud, etc. ALWAYS read from env (LOG_SHIP_DD_API_KEY, GF_API_KEY). Never write a token into any generated file.
  • Constructor Pattern. Each phase file < 100 LOC. This index < 120 LOC.
  • Surgical Changes. Only write to the target service repo's observability.md, config/prometheus.yml, config/otel-collector.yaml, dashboards/*.json, alerts/*.yaml. Do NOT touch application source beyond the minimum init-call required by Phase 2.

References

04 同仓库更多 Skills

KeiSeiLab
KeiSeiLab/KeiSeiKit

wave-audit

3-wave parallel audit — Wave 1 discovery (4 agents), Wave 2 verification (4 agents), Wave 3 cross-optimization (1 synthesizer). Each wave runs agents in parallel. Combines security review, runtime analysis, quality check, and constructor pattern into one unified workflow with evidence grading and Go/No-Go verdict.

★ 7
KeiSeiLab
KeiSeiLab/KeiSeiKit

vm-provision

End-to-end VPS provisioning — select provider → plan → provision → harden → verify (ssh-check + firewall-diff hard-gate) → handoff. 6 phases, ≥6 AskUserQuestion calls, defensive-only. Stops if either verification primitive fails.

★ 7
KeiSeiLab
KeiSeiLab/KeiSeiKit

visual-explainer

Generate beautiful, self-contained HTML pages that visually explain systems, code changes, plans, and data. Use when the user asks for a diagram, architecture overview, diff review, plan review, project recap, comparison table, or any visual explanation of technical concepts. Also use proactively when you are about to render a complex ASCII table (4+ rows or 3+ columns) — present it as a styled HTML page instead.

★ 7
KeiSeiLab
KeiSeiLab/KeiSeiKit

video-gen

Use when generating video from frame sequences — FFmpeg extraction, WebP/AVIF conversion, sprite sheets, scroll-synced playback, video encoding/transcoding. Covers the full pipeline from video source to web-ready frame sequence or optimized video.

★ 7
KeiSeiLab
KeiSeiLab/KeiSeiKit

test-matrix

Use when a project needs testing BEYOND unit tests — fuzzing, property-based, load, E2E, or mutation. Five-phase hub-and-spoke pipeline composes the right mix per language × critical path × CI target, scaffolds configs + corpus + fixtures, wires CI jobs, and defines the crash/regression triage workflow. Pure-click: every decision except intake is an AskUserQuestion.

★ 7
KeiSeiLab
KeiSeiLab/KeiSeiKit

test-gen

Use when generating tests for untested code — happy path, edge cases, error handling

★ 7