Guides implementation of structured logging, metrics collection, and distributed tracing for production services. Covers the three pillars of observability (logs, metrics, traces), OpenTelemetry integration, correlation ID propagation, alerting thresholds, and common anti-patterns. Use when adding monitoring to a service, debugging production issues, improving error visibility, setting up alerting, or instrumenting business metrics. Triggers: observability, logging, metrics, tracing, monitoring, OpenTelemetry, alerts, instrumentation, structured logs, correlation ID.
설치
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Guides implementation of structured logging, metrics collection, and distributed tracing for production services. Covers the three pillars of observability (logs, metrics, traces), OpenTelemetry integration, correlation ID propagation, alerting thresholds, and common anti-patterns. Use when adding monitoring to a service, debugging production issues, improving error visibility, setting up alerting, or instrumenting business metrics. Triggers: observability, logging, metrics, tracing, monitoring, OpenTelemetry, alerts, instrumentation, structured logs, correlation ID.
Best practices for structured logging, metrics collection, and distributed tracing in production services.
Capabilities
Design structured logging with proper log levels and JSON output
Implement correlation ID propagation across service boundaries
Instrument services with counters, gauges, and histograms
Set up OpenTelemetry for automatic and manual instrumentation
Define alerting thresholds using RED and USE methodologies
Identify and avoid common observability anti-patterns
Build dashboards covering rate, errors, and duration
Core Principles
Three Pillars -- Observability rests on logs (event records), metrics (numeric measurements), and traces (request flow). Each pillar serves a distinct debugging purpose; all three are needed for full visibility.
Structure Over Strings -- Always emit structured JSON logs rather than interpolated strings. Structured logs are searchable, parseable, and machine-readable.
Correlation Everywhere -- Every request must carry a correlation ID that propagates across all downstream services and appears in every log entry, metric label, and trace span.
Bounded Cardinality -- Metric labels must use bounded value sets. Unbounded labels (user IDs, request paths with parameters) cause metric explosion and storage issues.
Actionable Alerts Only -- Every alert must have a clear owner, a runbook, and a required action. If an alert fires and nobody needs to act, remove it.
Sensitive Data Exclusion -- Never log PII, secrets, tokens, or credentials. Redact or mask sensitive fields before they reach the logging pipeline.
Structured JSON logging configured with appropriate log levels
Correlation ID generated at ingress and propagated to all downstream calls
Error context captured including stack traces and request metadata
Key business metrics instrumented (signups, orders, revenue)
RED metrics instrumented for all services (rate, errors, duration)
USE metrics instrumented for critical resources (CPU, memory, connections)
Health check endpoints exposed and monitored
Alerting rules configured with clear thresholds and response procedures
Dashboards created for RED metrics and business KPIs
Sensitive data redacted from all log output
Metric label cardinality verified as bounded
OpenTelemetry or equivalent tracing SDK initialized
When to Escalate
Infrastructure team -- When setting up centralized log aggregation, metric storage backends (Prometheus, Datadog), or tracing collectors (Jaeger, Zipkin) at the platform level.
Security team -- When uncertain whether a data field constitutes PII or when logging requirements conflict with compliance obligations (GDPR, HIPAA).
SRE / On-call team -- When defining SLOs, error budgets, or paging thresholds that affect incident response workflows.
Architecture team -- When introducing a new observability vendor or making cross-cutting changes to the instrumentation strategy across multiple services.