memory_data/skills/structured-logging-and-observability/SKILL.md
Use this skill when building production services, pipelines, or automation that needs to be debugged, monitored, or audited. Add structured logs, metrics, and health checks before shipping any service.
npx skillsauth add aiming-lab/metaclaw structured-logging-and-observabilityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Log levels:
DEBUG: detailed diagnostic (off in production)INFO: normal operation milestonesWARNING: recoverable unexpected stateERROR: operation failed, action neededStructured logs (JSON) over free-form text:
import structlog
log = structlog.get_logger()
log.info("request_complete", method="POST", path="/api/data", status=200, latency_ms=42)
Metrics to expose: request rate, error rate, latency (p50/p95/p99), queue depth.
Health check endpoint: /health returning {"status": "ok"} — required for load balancers.
Anti-pattern: Logging only on error; you can't diagnose what you didn't observe.
development
Use this skill when creating charts, plots, or dashboards. Choose the visualization type that best communicates the data relationship before writing any plotting code.
testing
Use this skill before taking any action that is hard to reverse — deleting files, overwriting data, sending messages, pushing to remote, modifying production systems. Always pause, state what you are about to do, and confirm before executing.
research
Use this skill when you are not sure about a fact, have outdated knowledge, or the question is contested. Explicitly communicate the level of confidence instead of asserting uncertain things as fact.
tools
Use this skill when deciding which tools to call in an agentic workflow. Always choose the minimal, most direct tool for each step and avoid redundant or speculative tool calls.