Back to .md Directory

Monitoring & Observability

Prompts an SRE to design a full observability stack covering logging, metrics, tracing, alerting, SLOs, and incident response.

May 2, 2026
0 downloads
1 views
ai rag prompt
View source

What this file does

Prompts an SRE to design a full observability stack covering logging, metrics, tracing, alerting, SLOs, and incident response.

When to use it

  • Starting a new microservices project that needs monitoring from day one
  • Auditing an existing system's observability gaps
  • Preparing for an SRE or platform engineering interview
  • Defining monitoring requirements for a cloud migration

Assumes this stack

PrometheusGrafanaLokiTempoOpenTelemetryPagerDuty

Monitoring & Observability

Design a comprehensive observability stack with logging, metrics, tracing, and alerting.

Category

devops-cicd

Complexity

advanced

Prompt

You are an SRE / observability engineer. Design a monitoring and observability strategy for {{SYSTEM_NAME}}.

**Architecture:** {{ARCHITECTURE}}
**Stack:** {{TECH_STACK}}
**Cloud:** {{CLOUD_PROVIDER}}

**Design the three pillars of observability:**

### 1. Logging
- **Structured logging format** (JSON with standard fields):
  - `timestamp`, `level`, `message`, `service`, `traceId`, `spanId`, `userId`
- **Log levels:** When to use ERROR, WARN, INFO, DEBUG
- **What to log:** Request/response summaries, state changes, errors, audit events
- **What NOT to log:** PII, credentials, tokens, full request bodies with sensitive data
- **Log aggregation:** ELK / Loki / CloudWatch Logs
- **Retention policy:** Hot (7d) → Warm (30d) → Cold (90d) → Archive (1y)

### 2. Metrics
**Application metrics (RED method):**
- Rate: Requests per second
- Errors: Error rate / error percentage
- Duration: Latency percentiles (p50, p90, p99)

**Infrastructure metrics (USE method):**
- Utilization: CPU, memory, disk, network
- Saturation: Queue depth, thread pool usage, connection pool
- Errors: Hardware errors, timeout counts

**Business metrics:**
- {{BUSINESS_METRICS}}

**Metric collection:** Prometheus / CloudWatch Metrics / Datadog
**Dashboard design:** Per-service dashboard, system overview dashboard

### 3. Distributed Tracing
- Instrumentation: OpenTelemetry SDK integration
- Trace context propagation (W3C Trace Context)
- Span naming conventions
- Key spans to instrument (HTTP, database, cache, external calls)
- Sampling strategy (head-based vs. tail-based, sample rate)
- Trace storage: Jaeger / Tempo / X-Ray / Application Insights

### 4. Alerting Strategy

| Alert | Condition | Severity | Notification | Runbook |
|-------|-----------|----------|-------------|---------|
| High error rate | > 1% 5xx for 5min | Critical | PagerDuty | link |
| High latency | p99 > 2s for 10min | Warning | Slack | link |
| Pod crash loop | > 3 restarts in 10min | Critical | PagerDuty | link |
| Disk usage | > 80% | Warning | Slack | link |
| Certificate expiry | < 30 days | Warning | Email | link |

**Alert anti-patterns to avoid:**
- Alert fatigue (too many non-actionable alerts)
- Missing runbooks
- Alerting on symptoms, not causes

### 5. SLIs, SLOs, and Error Budgets
- Define SLIs (Service Level Indicators) for key user journeys
- Set SLOs (Service Level Objectives) with percentages
- Calculate error budget and burn rate alerting

### 6. On-Call & Incident Response
- Escalation policy
- Incident severity definitions
- Communication templates
- Post-incident review process

**Provide:** Configuration examples for {{MONITORING_STACK}}.

Variables

VariableDescriptionExample
{{SYSTEM_NAME}}System to monitorE-Commerce Platform
{{ARCHITECTURE}}Architecture type12 microservices on Kubernetes
{{TECH_STACK}}Application stackNode.js, Python, PostgreSQL, Redis, Kafka
{{CLOUD_PROVIDER}}CloudAWS, Azure, GCP
{{BUSINESS_METRICS}}Key business metricsOrders/min, cart abandonment, payment success rate
{{MONITORING_STACK}}Monitoring toolsPrometheus + Grafana + Loki + Tempo

Tips & Variations

  • Add: "Generate Grafana dashboard JSON for the key metrics."
  • Add: "Design synthetic monitoring / uptime checks."

What's inside

6 sections: logging, metrics, tracing, alerting, SLIs/SLOs, incident response, plus variables table and tips

Change this for your project

  • Replace {{SYSTEM_NAME}} with your system name
  • Replace {{ARCHITECTURE}} with your architecture description
  • Replace {{TECH_STACK}} with your actual tech stack
  • Replace {{MONITORING_STACK}} with the tools you use

Where it goes

Keep with your observability configuration. Describes what to track and alert on.

Worth borrowing

  • RED and USE methods for metrics selection
  • Burn rate alerting tied to error budgets
  • Structured logging schema with trace context propagation

Related Documents