Design a complete observability stack with metrics, logging, tracing, alerting, and dashboards for production systems.
## ROLE You are a site reliability engineer who has built observability platforms for systems serving millions of users. You understand the three pillars of observability — metrics, logs, and traces — and how they complement each other. You know that observability is not about collecting data — it is about being able to answer any question about your system's behavior using the data you collect. You design observability systems that enable rapid incident diagnosis without requiring the engineer to have seen the specific problem before. ## CONTEXT You cannot fix what you cannot see. Most production incidents are prolonged not because the fix is complex but because finding the root cause takes too long. Observability — the ability to understand the internal state of a system from its external outputs — is the difference between resolving an incident in 5 minutes and spending 2 hours guessing. But many teams confuse monitoring (watching known metrics for known thresholds) with observability (being able to ask arbitrary questions about system behavior). True observability requires structured data that supports ad-hoc investigation. ## TASK Design a complete observability architecture: 1. **Metrics Architecture**: Design the metrics collection system: application metrics (request rate, error rate, latency percentiles — the RED method), business metrics (sign ups, conversions, revenue), infrastructure metrics (CPU, memory, disk, network), and custom metrics for domain-specific monitoring. Choose between Prometheus, Datadog, or CloudWatch with justification. 2. **Logging Architecture**: Design structured logging: log format (JSON with standard fields: timestamp, level, service, request_id, user_id), log levels (when to use each: debug, info, warn, error), log aggregation (ELK, Loki, CloudWatch Logs), and log retention policy (hot/warm/cold storage). 3. **Distributed Tracing**: Design the tracing system: instrumentation (OpenTelemetry SDK), trace context propagation (W3C Trace Context), span design (meaningful span names, relevant attributes), sampling strategy (head-based vs. tail-based, sample rate), and trace storage (Jaeger, Zipkin, Tempo). 4. **Alerting Strategy**: Design the alerting system: alert rules based on SLOs (not arbitrary thresholds), alert severity levels (page vs. ticket vs. inform), alert routing (PagerDuty/Opsgenie), runbook links in every alert, and alert fatigue prevention (aggregate, deduplicate, suppress during maintenance). 5. **Dashboards**: Design dashboards for different audiences: executive dashboard (system health, SLA status, incident count), on-call dashboard (current alerts, system overview, recent deployments), and service-specific dashboards (detailed metrics per service with latency, errors, saturation). 6. **SLO/SLI Framework**: Define Service Level Indicators and Objectives: availability SLO (99.9%), latency SLO (p99 under 500ms), error rate SLO (under 0.1%), and error budgets. Show how SLOs drive alerting and prioritization. 7. **Correlation**: Design how to correlate across the three pillars: from an alert (metric) to relevant logs to distributed traces. Use request IDs, trace IDs, and timestamp correlation to enable seamless investigation. 8. **Cost Optimization**: Design for cost efficiency: appropriate log levels (not debug in production), trace sampling (not 100% sampling), metric cardinality management (avoid high-cardinality labels), and retention tier management. ## INFORMATION ABOUT ME - [SYSTEM ARCHITECTURE] (monolith, microservices, serverless) - [CLOUD PROVIDER] - [CURRENT OBSERVABILITY TOOLS] (if any) - [TEAM SIZE AND ON-CALL STRUCTURE] - [SLA COMMITMENTS] ## RESPONSE FORMAT Deliver: observability architecture diagram, tool selection rationale, instrumentation guide, alert rule definitions, dashboard specifications, and SLO framework. Include cost estimation for the chosen tools.
Or press ⌘C to copy
Replace these placeholders with your own content before using the prompt.
[SYSTEM ARCHITECTURE][CLOUD PROVIDER][CURRENT OBSERVABILITY TOOLS][SLA COMMITMENTS]