observability-when-to-add
Skill2 starsChanged 6 months agoMITView on GitHub
Instrumentation is directed, not preventive — add observability only when confirmed pain exists. Follow industry standards (OpenTelemetry, structured logging, performance.now()). Use when implementing metrics, tracing, performance debugging, or asking whether instrumentation is needed.
In this repository30 other files it gives its agents.
- adr-spec-gateSkill
- agent-continuity-loopSkill
- agent-flywheelSkill
- agent-runtime-paritySkill
- business-guardrailsSkill
- compact-instructionsSkill
- debug-protocolSkill
- dns-and-whois-toolsSkill
- docs-as-codeSkill
- engineering-standardsSkill
- excellence-no-intermediatesSkill
- git-pr-rulesSkill
- hooks-for-enforcementSkill
- hooks-multi-tool-paritySkill
- iac-first-commitSkill
- impact-metrics-gateSkill
- large-payload-completenessSkill
- ledger-auto-updatesSkill
- llm-model-selectionSkill
- local-service-autostartSkill
- multi-phase-sessionSkill
- new-projectSkill
- notion-apiSkill
- notion-batch-patternSkill
- permanent-learning-protocolSkill
- progress-md-businessSkill
- reactive-integration-designSkill
- secure-secret-inputSkill
- tokens-taxonomySkill
- version-bump-rulesSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
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
- Distinctive: line 21
Before you have identified a concrete bottleneck or failure mode
- Distinctive: line 36
NOT every function, NOT every variable assignment
- Distinctive: line 44
All log writes go in try/catch blocks (silent failure okay)
- Distinctive: line 45
If the observability system is down, the application runs normally
- Very specific: line 60
NOT wall-clock time (Date.now(), time.time()) — wall clocks can jump backward
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Observability & Instrumentation — Directed, Not Preventive
Industry principle (Google SRE Book, Honeycomb, Charity Majors): instrumentation carries maintenance cost proportional to its value. Every metric is code to maintain, schema that can break, storage cost, and signal to interpret. You instrument when you have confirmed pain, not "just in case."
When to add observability
- Performance bug you cannot locate (classic in multi-threaded, async, or distributed systems)
- External SLA or performance requirement demands metrics
- System is in production with real user traffic
- Flow analysis is part of the product itself (user journey tracking, etc.)
When NOT to add observability
- "Good practice" or preventive coverage before pain is identified
- Small side projects in active development
- Before you have identified a concrete bottleneck or failure mode
- To satisfy an abstract rule like "instrument everything"
What to use when you decide to instrument
- Production / real traffic → OpenTelemetry (CNCF graduated project) + collector + backend (Honeycomb, Tempo, Jaeger, or cloud equivalent)
- Local development / single-user → structured JSON logging +
jq/grep. Addcorrelation_idif the call crosses process boundaries. - Spot performance hunt → use language builtins (
console.time/console.timeEndin JavaScript,time.perf_counter()in Python, etc.). Discard after resolving the issue.
Universal principles when instrumenting
Instrument boundaries, not internals
- Entry points (API handlers, RPC endpoints)
- Network calls (HTTP, gRPC, database queries)
- External service boundaries
- NOT every function, NOT every variable assignment
Aggressive sampling in production
- Default: 1-10% of requests
- 100% only in development or for high-value (error) events
- Sampling reduces noise and cost without losing signal on aggregate behavior
Telemetry failure must not cascade
- All log writes go in try/catch blocks (silent failure okay)
- If the observability system is down, the application runs normally
- Observability is about understanding running systems, not blocking them
Never log PII, tokens, or raw payloads
- Log summaries instead of bodies (e.g., "request 256 bytes to /api/v1/users" not the JSON)
- Redact or hash sensitive fields
- Assume logs are readable by ops teams and retained for weeks
Use verb:noun naming for events
- Examples:
fetch:external_api,query:database,publish:event - This naming schema makes
grepwork reliably months later - Easier to discover related events and trace flows
Use monotonic clocks for duration
performance.now()(JavaScript),time.perf_counter()(Python),System.nanoTime()(Java)- NOT wall-clock time (
Date.now(),time.time()) — wall clocks can jump backward - Duration must be reliable across system-clock corrections
Red flags — when you're over-instrumenting
- Observability code is more complex than the business logic it instruments
- You added metrics months ago and have never queried them
- The instrumentation is "just in case" with no corresponding monitoring/alerting
- Log volume exceeds bandwidth or storage budget
- You notice yourself filtering/ignoring metrics because they're too noisy
Canonical references
- Google SRE Book, chapters 6 (Monitoring Distributed Systems) and 12 (Effective Troubleshooting)
- Charity Majors, "Observability is for Unknown Unknowns"
- OpenTelemetry specification: https://opentelemetry.io/
- Honeycomb Observability Guide: https://www.honeycomb.io/
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
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.

