Structured logging and observability

From aiming-lab/MetaClaw · View interactive version

Structured logging and observability is an AI agent skill from the GitHub repository aiming-lab/MetaClaw. 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.

How to use this skill

Skill file

Structured Logging and Observability

Log levels:

Structured 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.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.