agentleFS
DnsQueenDnsQueen/orcinus-skills/skills/monitoring/SKILL.md

monitoring

Skill1 starsChanged 5 days agoMITView on GitHub

Use when setting up uptime and health monitoring, alerts, or on-call basics for a service already in production, so you learn it is down before customers do — health and readiness probes, alerting on SLO error-budget burn rather than raw counts, curing alert fatigue, on-call rotation with escalation, and a status page. NOT instrumenting logs, metrics or traces, or wiring OpenTelemetry (that is `monitoring-observability`). Only invoke via the orcinus router.

16 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use authentication, database and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    authentication

    Wire this in whenever the app uses or connects to data — records, a database, entities, per-user data, row-level security — or when the user wants sign-in, accounts, login, or protected pages. Rayfin data is always accessed as an authenticated user, so **data implies auth**; only a static page over public data skips it. The starter ships as a no-auth "hello world" that previews with no backend, and the full Fabric auth scaffolding is already in the project — this skill wires it in: AuthProvider + bootstrapAuth in main.tsx, the route guard in App.tsx, the sign-in page, sign-out, and the env/deploy requirement. Triggers: auth, authentication, sign in, sign-in, login, log in, sign out, logout, account, user, identity, protect route, require login, gated page, data, database, records, per-user, row-level security, who is the current user, Fabric auth, Entra.

    Also in 3 projects that use this

  • mijunriSkill

    database

    数据库脚本与操作规范。脚本放在 db_scripts 目录,遵循查询优化、事务、安全等实践。

    Also in 3 projects that use this

  • JohnJBorenSkill

    ci-cd

    CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies

    Also in 3 projects that use this

  • wrsmith108Skill

    docker

    Container-based development for isolated, reproducible environments. Use when running npm commands, installing packages, executing code, or managing project dependencies. Trigger phrases include "npm install", "run the build", "start the server", "install package", or any code execution request.

    Also in 4 projects that use this

  • klauswgSkill

    performance

    Optimize web performance for faster loading and better user experience. Use when asked to "speed up my site", "optimize performance", "reduce load time", "fix slow loading", "improve page speed", or "performance audit".

    Also in 4 projects that use this

  • mrgoonieSkill

    devops

    Deploy to Cloudflare (Workers, R2, D1), Docker, GCP (Cloud Run, GKE), Kubernetes (kubectl, Helm). Use for serverless, containers, CI/CD, GitOps, security audit.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If an alert doesn't map to an immediate human action, it is not a page — it's noise, and noise trains people to ignore the one page that …

    line 20
  2. Distinctive:

    Don't skip layers and don't collapse them — each answers a different question.

    line 24
  3. Very specific:

    Runbook per alert: every alert links to a runbook with five fields — Symptom, Impact, First 3 checks, Mitigation, How to escalate.

    line 119
  4. Distinctive:

    An untested alert is not an alert: Before you call monitoring "done," prove the wire end-to-end:

    line 125

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Monitoring

You are wiring up the outside view of a service that already shipped: is it alive, is it fast, and when it breaks, does exactly one human get exactly one actionable page. This skill emits a concrete setup — a checker config, a health-endpoint contract, symptom-based alert rules, and an on-call rotation. Not telemetry instrumentation (that is monitoring-observability), not the release-gating healthcheck.

The one rule

A page is justified only when there is real user impact AND a human action the system can't take itself. Everything below descends from this. Internalize the three tiers:

  • Page (wake someone): users are hurting now and a human must intervene. Checkout returns 5xx. Site unreachable. Error budget burning fast.
  • Ticket (look during business hours): degraded but not bleeding. Slow-burn budget use, cert expiring in 14 days.
  • Dashboard-only (don't notify): CPU at 80%, a single retry, a transient blip the system already healed.

If an alert doesn't map to an immediate human action, it is not a page — it's noise, and noise trains people to ignore the one page that matters.

The 4-layer stack

Don't skip layers and don't collapse them — each answers a different question.

LayerAnswersBuilt withFires when
1. External uptime probe"Is it reachable from the outside?"Uptime Kuma / UptimeRobot / Better StackURL down, TLS broken, p95 latency over budget
2. Health endpoints"Is the process alive, and are its deps reachable?"/livez + /readyz on the serviceliveness fails → restart; readiness fails → pull from rotation
3. SLO burn-rate alert"Are we spending the error budget too fast?"Prometheus/Grafana/Better Stack rulemulti-window burn rate exceeds threshold
4. On-call escalation"Who acts, and who's the backup?"PagerDuty / incident.io / Better Stacka page from layers 1–3 routes + escalates

Layer 1 catches "the whole thing is gone." Layer 2 catches "a dependency died" before users do. Layer 3 catches "we're degrading faster than we can afford." Layer 4 makes sure a human shows up.

Pick a tool

Decide by budget, team size, and self-host appetite. Pricing as of 2026-06.

ToolFree tierCheck intervalBest forPaid from
Uptime Kuma 2.1.3Fully free, self-hosteddown to ~20sfull control, you have a VPS$0 (you pay the box)
UptimeRobot50 monitors @ 5-min, 1 status page5-min free / 1-min paidno infra, want managed$7/mo
Better Stack10 monitors + incidents + logs30sincident mgmt + on-call in one$24/mo
Pingdomnonesub-minuteenterprise synthetic + RUM$15/mo

Default: Uptime Kuma if you already run a VPS (1 GB box is comfortable; needs ~400 MB RAM), UptimeRobot free tier if you don't want infra. Kuma 2.1 added Globalping worldwide probe locations (so you test from regions, not just your one box) and built-in domain-expiry monitors. Concrete docker-compose and notification wiring live in references/tool-setup.md.

Health endpoints done right

Split liveness from readiness — they trigger different machine actions.

  • /livez (liveness): is the process healthy? If it fails, the orchestrator restarts the container. Keep it dumb: just "am I running and not deadlocked." Never check the database here.
  • /readyz (readiness): are dependencies reachable so I can serve traffic? If it fails, the orchestrator pulls this instance from the load-balancer rotation but does not kill it.

The cheap-probe rule: a probe runs constantly, so it must be <100ms and must not cascade-check every downstream. Why: if /livez pings the DB and the DB is briefly slow, liveness fails, the container restarts, the restart hammers the recovering DB — a restart loop that turns a 30-second blip into an outage.

# Bad — one /health that cascades and returns 500 on any hiccup.
# A slow Redis takes the whole service down and triggers restart loops.
@app.get("/health")
def health():
    db.execute("SELECT 1")          # blocks
    redis.ping()                    # blocks
    requests.get(PAYMENTS_URL)      # blocks on a third party!
    return {"status": "ok"}         # 500 if ANY of these throws
# Good — split, cheap, correct status codes, small JSON.
@app.get("/livez")                  # liveness: process only. Restart if this fails.
def livez():
    return {"status": "alive"}      # 200, ~1ms, touches nothing downstream

@app.get("/readyz")                 # readiness: deps with short timeouts. Pull from LB if this fails.
def readyz():
    checks = {"db": ping(db, timeout=0.2), "cache": ping(redis, timeout=0.1)}
    ok = all(checks.values())
    return JSONResponse(
        {"status": "ready" if ok else "degraded", "checks": checks},
        status_code=200 if ok else 503,   # 503 so the LB pulls this instance
    )

Do not put a third-party API call in readiness — a payment provider's outage shouldn't pull all your instances from rotation and take you fully down. Degrade that path in code, don't fail-closed on it here. Go and FastAPI handler examples are in references/tool-setup.md.

What to actually monitor

The golden checklist. Monitor the symptom users feel, not just that one URL returns 200.

  • Availability — the critical endpoint(s) reachable, from multiple regions.
  • Latency p95/p99 — averages hide the tail; alert on p95/p99 against a budget, not the mean.
  • Error rate — the 5xx-to-total ratio, because raw 5xx count says nothing without traffic volume.
  • SSL cert expiry — alert at 14 days; an expired cert is a full outage that no app metric catches.
  • Domain expiry — alert at 30 days; a lapsed domain is the most embarrassing avoidable outage.
  • The critical user journey — a synthetic check that does login → core action → result, NOT just GET /. The homepage can be 200 while checkout is broken.

The homepage being up tells you almost nothing. Probe the path that makes you money.

Alerts that don't cry wolf

Alert on symptoms, not causes. Page on "checkout error rate >2% for 5 min" (user impact), not on "CPU >80%" (a cause that may be harmless and self-resolving). High CPU with happy users is a dashboard line, not a 3am page.

Use multi-window, multi-burn-rate for SLO alerts (Google SRE workbook). Burn rate = how fast you're spending the monthly error budget. Require a long and a short window to both fire — the long window says "this is real," the short window says "this is still happening," and together they kill false positives from a single spike.

Burn rateWindowBudget spentSeverityAction
> 14.41h (+ 5m short)2% in 1hcriticalpage
> 66h (+ 30m short)5% in 6hwarningticket
> 13d (+ 6h short)10% in 3dinforeview

Routing: critical → page, warning → ticket, info → dashboard/review. Dedupe and group related alerts into one incident (10 hosts failing the same check = one page, not ten). Set maintenance windows so planned deploys don't page anyone.

Scale by criticality: for a small or single-user service, the on-call is just the owner — no rotation, no escalation chain, and the SLO can be a single availability target (for example 99% uptime over 30 days). Add a rotation and a secondary only when more than one person is on call, and add burn-rate alerts only when the service has a real error budget to spend. Do not build a full on-call rotation for a service with one user. The full burn-rate math and a copy-paste Prometheus-style rule with a runbook_url annotation are in references/burn-rate-and-oncall.md.

On-call basics

  • Rotation: weekly, with a primary and a secondary. One person can't be the single point of failure for the system that catches single points of failure.
  • Escalation policy: page primary → if no ack in 5–10 min, page secondary → then the manager. No-ack must always hop; an unacked page is a dropped page.
  • Runbook per alert: every alert links to a runbook with five fields — Symptom, Impact, First 3 checks, Mitigation, How to escalate. The person paged at 3am should not have to think from scratch. Template in references/burn-rate-and-oncall.md.
  • Status page + comms: a public status page (Kuma and Better Stack include one) so customers self-serve "is it you or me," cutting inbound during an incident.
  • Do NOT start a new on-call on Opsgenie — Atlassian is retiring it (EOL 2027-04-05; new sales ended 2025-06-04). Grafana OnCall OSS was also deprecated (folded into Grafana Cloud IRM). For a new setup use PagerDuty, incident.io, Better Stack, or Grafana Cloud IRM.

Verify it works

An untested alert is not an alert. Before you call monitoring "done," prove the wire end-to-end:

  1. Trigger a real synthetic failure (stop the service, or point a monitor at a forced-503 route).
  2. Confirm the page actually lands on a phone — not just "the rule exists in the UI."
  3. Let the ack timeout lapse and confirm escalation hops to the secondary.
  4. Restore, and confirm the resolve/all-clear notification fires too.

scripts/verify.sh enforces the structural half of this on your config: liveness split from readiness, at least one symptom/burn-rate alert with two windows, a runbook reference somewhere in the alert rules, and a banlist for Opsgenie-as-new-setup and homepage-only monitors. The runbook check is haystack-wide — one reference anywhere passes; it does not prove every alert has one (see the script's header). Run it in CI so config drift can't silently re-introduce a noisy or untested setup.

Anti-patterns

BadWhy it bitesDo instead
Monitor only the homepage // is 200 while checkout is broken — you learn from customerssynthetic check of the critical journey
Page on CPU/memory thresholdself-resolves, no user impact → alert fatiguepage on the symptom (error rate, latency, availability)
Alert on cause, not symptomcauses are noisy and ambiguousalert on what the user feels
Alert with no runbook linkthe paged human improvises at 3amevery alert links a 5-field runbook
Single-window threshold "by vibes"one spike pages; tuned by guessworkmulti-window multi-burn-rate against an SLO
Probe cascades every downstreamone slow dep fails the probe → restart loopcheap <100ms probe, deps in readiness with timeouts
Liveness checks the databaseslow DB → restart loop turns a blip into an outageliveness = process only; DB lives in readiness
Start new on-call on OpsgenieEOL 2027-04-05, dead endPagerDuty / incident.io / Better Stack / Grafana Cloud IRM
No secondary on-callprimary asleep/offline → page droppedprimary + secondary + manager escalation
No status pageinbound floods support during incidentspublic status page customers can self-serve
Never tested the alert"the rule exists" ≠ "the page lands"trigger a synthetic failure, confirm it pages + escalates
Page on warningstrains people to ignore pageswarning → ticket; only critical → page

References

  • references/tool-setup.md — Uptime Kuma docker-compose (rootless image, volume, port), HTTP + push-heartbeat + SSL/domain-expiry monitors, a synthetic multi-step journey, notification wiring (ntfy / Slack webhook / PagerDuty integration key), a UptimeRobot/Better Stack monitor JSON shape, and Go + FastAPI health-endpoint handlers.
  • references/burn-rate-and-oncall.md — full multi-window multi-burn-rate math, a copy-paste Prometheus-style alert rule with runbook_url, severity mapping, a sample escalation-policy YAML, and a fill-in runbook template.

Related in this repo: monitoring-observability — the telemetry side (what the app emits: logs, metrics, traces). The other siblings this skill originally linked to (observability, deployment, error-handling, domains-dns, scaling) are not part of ORCINUS; the links were removed because they pointed nowhere after installation.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.