Agent skill
logging-observability
Implement structured logging, tracing, and metrics for debugging
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/logging-observability
SKILL.md
Skill: logging-observability
What I do
I provide expertise in implementing structured logging, tracing, and metrics to ensure system observability. I focus on creating a clear, actionable data trail that allows for rapid debugging and performance analysis in production environments.
When to use me
- When designing a new service's logging strategy
- When instrumenting code with distributed tracing spans
- When adding metrics to track business-critical KPIs or system health
- When debugging complex, distributed issues that span multiple services
Core principles
- Structure over prose: Use structured formats like JSON to make logs easily searchable and machine-readable.
- Actionability: Every log message and metric should have a clear purpose. Avoid noise that obscures real issues.
- Context is king: Include correlation IDs, request IDs, and relevant metadata (e.g., user ID, tenant ID) in every log entry.
- The three pillars: Combine logs (discrete events), traces (request flow), and metrics (aggregates) for a complete view of system health.
Patterns & examples
Structured logging (JSON):
{
"level": "info",
"ts": "2026-02-22T21:00:00Z",
"msg": "processed order",
"order_id": "ORD-123",
"user_id": "USR-456",
"duration_ms": 150,
"correlation_id": "CORR-789"
}
Log levels guide:
- DEBUG: Verbose information for development and troubleshooting.
- INFO: General operational events (e.g., service started, request completed).
- WARN: Unexpected but non-critical events that might require attention.
- ERROR: Critical failures that require immediate investigation.
Distributed tracing: Use OpenTelemetry to start spans at the beginning of a request and inject the context into downstream calls. This allows you to visualize the entire lifecycle of a request across multiple services.
Metrics types:
- Counters: For events that only increase (e.g., total requests, error count).
- Gauges: For values that go up and down (e.g., current memory usage, active connections).
- Histograms: For distributions of values (e.g., request latency, payload size).
Anti-patterns to avoid
- ❌ Log noise: Logging every trivial operation at the INFO level. This increases storage costs and makes finding real issues harder.
- ❌ Sensitive data in logs: Never log passwords, PII, or secrets. Always scrub or mask sensitive fields.
- ❌ Missing correlation IDs: Logs without a way to link them across services are nearly useless in distributed systems.
- ❌ Ignoring metrics: Relying solely on logs for health monitoring. Use metrics for real-time alerting and dashboards.
KB Reference
~/vaults/baphled/3. Resources/Knowledge Base/AI Development System/Skills/DevOps-Operations/Logging Observability.md
Related skills
devops: For infrastructure and deployment considerationsautomation: For setting up alerting based on metrics and logssecurity: For ensuring logging practices meet compliance and data privacy standardsperformance: For using traces and metrics to identify and fix bottlenecks
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?