Observability Design
Purpose
Design a comprehensive observability strategy covering metrics, logging, tracing, alerting, and SLI/SLO definitions. Produces a monitoring architecture that enables rapid incident detection, diagnosis, and resolution.
Scope Constraints
Reads system architecture documentation, existing monitoring configurations, and service definitions for observability analysis. Does not modify files, deploy monitoring agents, or access production telemetry data directly.
Inputs
- System architecture (services, databases, APIs, third-party dependencies)
- Current monitoring setup (existing tools, dashboards, alerts)
- Reliability requirements (SLA commitments, uptime targets)
- Team structure (on-call rotation, escalation paths)
Input Sanitization
No user-provided values are used in commands or file paths. All inputs are treated as read-only analysis targets.
Procedure
Progress Checklist
Step 1: Define Observability Pillars
Establish the three pillars for this system:
- Metrics: What to measure — request rate, error rate, latency, saturation, business KPIs
- Logs: What to record — request lifecycle, state changes, errors, audit events
- Traces: What to follow — cross-service request flows, database queries, external API calls
- Map each pillar to specific use cases: debugging, alerting, capacity planning, business intelligence
Step 2: Design Metric Collection
Define the metric taxonomy:
- Application metrics: Request count, error count, latency histograms, queue depth, cache hit rate
- Infrastructure metrics: CPU, memory, disk I/O, network throughput, connection pool utilization
- Business metrics: Sign-ups, conversions, revenue events, feature adoption rates
- Custom instrumentation: Counters (events), gauges (current values), histograms (distributions)
- Specify metric naming conventions, label/tag strategy, and cardinality limits
Step 3: Define Alert Thresholds and Escalation
Design the alerting strategy:
- Warning alerts: Early indicators — elevated error rate, latency creep, resource approaching limits
- Critical alerts: Immediate action required — service down, error rate spike, SLO burn rate exceeded
- Escalation paths: Primary on-call → secondary → engineering lead → incident commander
- Runbook links: Every alert includes a link to its diagnosis and remediation runbook
- Alert fatigue prevention: Grouping, deduplication, silence windows, alert quality reviews
Step 4: Plan Structured Logging
Design the logging architecture:
- Log levels: DEBUG (development only), INFO (normal operations), WARN (unexpected but handled), ERROR (requires attention)
- Structured fields: timestamp, service, request_id, user_id, action, duration_ms, status
- Correlation IDs: Request ID propagation across services for distributed request tracing
- PII redaction: Identify sensitive fields, implement automatic redaction/masking
- Log aggregation: Collection, indexing, retention periods, search capabilities
Step 5: Design Distributed Tracing
Plan request flow visibility:
- Span naming conventions:
service.operation format, consistent across services
- Context propagation: How trace context passes between services (headers, message metadata)
- Sampling strategy: Head-based vs tail-based sampling, sampling rate by endpoint or error status
- Trace enrichment: Adding business context (user tier, feature flag state) to spans
- Critical paths: Which request flows must always be traced (payments, auth, data mutations)
Step 6: Specify Dashboard Requirements
Define dashboard hierarchy:
- Operational dashboards: Service health overview, real-time traffic, error rates, latency percentiles
- Business dashboards: User activity, feature adoption, conversion funnels, revenue metrics
- SLO dashboards: Error budget remaining, burn rate, SLO compliance history
- Incident dashboards: Pre-built investigation views for common failure modes
- Specify dashboard layout, refresh intervals, time range defaults, and access controls
Step 7: Define SLIs/SLOs
Establish reliability targets:
- Availability SLI: Successful requests / total requests (define "successful")
- Latency SLI: Proportion of requests faster than threshold (p50, p95, p99 targets)
- Error rate SLI: Proportion of requests without errors (define "error")
- SLO targets: e.g., 99.9% availability, p95 latency < 200ms, error rate < 0.1%
- Error budgets: Calculate error budget from SLO, define burn rate alerts (fast burn, slow burn)
- SLO review cadence: Weekly error budget check, monthly SLO review, quarterly target adjustment
Compaction resilience: If context was lost during a long session, re-read the Inputs section to reconstruct what system is being analyzed, check the Progress Checklist for completed steps, then resume from the earliest incomplete step.
Output Format
# Observability Design: [Service/Feature Name]
## Observability Architecture
[Application] → [Metrics Agent] → [Metrics Store] → [Dashboards]
↓ ↓
[Structured Logs] → [Log Aggregator] → [Log Search] [Alerts] → [On-call]
↓
[Trace SDK] → [Trace Collector] → [Trace UI]
## Metric Catalog
| Metric Name | Type | Labels | Description | Alert Threshold |
|-------------|------|--------|-------------|-----------------|
| http_requests_total | counter | method, path, status | Request count | N/A |
| http_request_duration_ms | histogram | method, path | Request latency | p95 > 500ms |
| ... | ... | ... | ... | ... |
## Alert Catalog
| Alert Name | Severity | Condition | Duration | Runbook |
|------------|----------|-----------|----------|---------|
| HighErrorRate | critical | error_rate > 5% | 5m | [link] |
| LatencyDegraded | warning | p95 > 500ms | 10m | [link] |
| ... | ... | ... | ... | ... |
## Logging Schema
```json
{
"timestamp": "ISO8601",
"level": "INFO",
"service": "api",
"request_id": "uuid",
"user_id": "string (optional)",
"action": "string",
"duration_ms": "number",
"status": "number",
"message": "string"
}
SLI/SLO Definitions
| SLI |
Measurement |
SLO Target |
Error Budget (30d) |
| Availability |
successful requests / total |
99.9% |
43.2 min downtime |
| Latency |
requests < 200ms / total |
99.0% |
432 min slow |
| Error Rate |
non-error requests / total |
99.9% |
0.1% errors |
Dashboard Specifications
| Dashboard |
Audience |
Key Panels |
Refresh |
| Service Health |
On-call |
Traffic, errors, latency, saturation |
30s |
| SLO Status |
Engineering |
Error budget, burn rate, compliance |
5m |
| Business Metrics |
Product |
Adoption, conversions, revenue |
1h |
## Handoff
- Hand off to deployment-plan if observability findings reveal deployment pipeline gaps (e.g., missing health checks, no canary metrics integration).
- Hand off to cost-analysis if telemetry storage, metric cardinality, or log retention volumes raise infrastructure cost concerns.
## Quality Checks
- [ ] All three observability pillars (metrics, logs, traces) are covered
- [ ] Every alert has a defined severity, threshold, and linked runbook
- [ ] Structured logging schema includes correlation IDs for distributed tracing
- [ ] PII fields are identified with redaction strategy
- [ ] SLIs are measurable and SLO targets are realistic for the service tier
- [ ] Error budgets are calculated with burn rate alert thresholds
- [ ] Dashboard hierarchy covers operational, business, and SLO views
- [ ] Sampling strategy balances trace coverage with storage costs
## Evolution Notes
<!-- Observations appended after each use -->
---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/dtsong) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->
1---2name: observability-design3description: Use when designing monitoring, alerting, logging, tracing, and SLI/SLO strategies for services or systems. Covers metric collection, structured logging, distributed tracing, dashboard design, and error budget management. Do not use for deployment pipeline design (use deployment-plan) or infrastructure cost modeling (use cost-analysis).4---56# Observability Design78## Purpose910Design a comprehensive observability strategy covering metrics, logging, tracing, alerting, and SLI/SLO definitions. Produces a monitoring architecture that enables rapid incident detection, diagnosis, and resolution.1112## Scope Constraints1314Reads system architecture documentation, existing monitoring configurations, and service definitions for observability analysis. Does not modify files, deploy monitoring agents, or access production telemetry data directly.1516## Inputs1718- System architecture (services, databases, APIs, third-party dependencies)19- Current monitoring setup (existing tools, dashboards, alerts)20- Reliability requirements (SLA commitments, uptime targets)21- Team structure (on-call rotation, escalation paths)2223## Input Sanitization2425No user-provided values are used in commands or file paths. All inputs are treated as read-only analysis targets.2627## Procedure2829### Progress Checklist30- [ ] Step 1: Define observability pillars31- [ ] Step 2: Design metric collection32- [ ] Step 3: Define alert thresholds and escalation33- [ ] Step 4: Plan structured logging34- [ ] Step 5: Design distributed tracing35- [ ] Step 6: Specify dashboard requirements36- [ ] Step 7: Define SLIs/SLOs3738### Step 1: Define Observability Pillars3940Establish the three pillars for this system:41- **Metrics**: What to measure — request rate, error rate, latency, saturation, business KPIs42- **Logs**: What to record — request lifecycle, state changes, errors, audit events43- **Traces**: What to follow — cross-service request flows, database queries, external API calls44- Map each pillar to specific use cases: debugging, alerting, capacity planning, business intelligence4546### Step 2: Design Metric Collection4748Define the metric taxonomy:49- **Application metrics**: Request count, error count, latency histograms, queue depth, cache hit rate50- **Infrastructure metrics**: CPU, memory, disk I/O, network throughput, connection pool utilization51- **Business metrics**: Sign-ups, conversions, revenue events, feature adoption rates52- **Custom instrumentation**: Counters (events), gauges (current values), histograms (distributions)53- Specify metric naming conventions, label/tag strategy, and cardinality limits5455### Step 3: Define Alert Thresholds and Escalation5657Design the alerting strategy:58- **Warning alerts**: Early indicators — elevated error rate, latency creep, resource approaching limits59- **Critical alerts**: Immediate action required — service down, error rate spike, SLO burn rate exceeded60- **Escalation paths**: Primary on-call → secondary → engineering lead → incident commander61- **Runbook links**: Every alert includes a link to its diagnosis and remediation runbook62- **Alert fatigue prevention**: Grouping, deduplication, silence windows, alert quality reviews6364### Step 4: Plan Structured Logging6566Design the logging architecture:67- **Log levels**: DEBUG (development only), INFO (normal operations), WARN (unexpected but handled), ERROR (requires attention)68- **Structured fields**: timestamp, service, request_id, user_id, action, duration_ms, status69- **Correlation IDs**: Request ID propagation across services for distributed request tracing70- **PII redaction**: Identify sensitive fields, implement automatic redaction/masking71- **Log aggregation**: Collection, indexing, retention periods, search capabilities7273### Step 5: Design Distributed Tracing7475Plan request flow visibility:76- **Span naming conventions**: `service.operation` format, consistent across services77- **Context propagation**: How trace context passes between services (headers, message metadata)78- **Sampling strategy**: Head-based vs tail-based sampling, sampling rate by endpoint or error status79- **Trace enrichment**: Adding business context (user tier, feature flag state) to spans80- **Critical paths**: Which request flows must always be traced (payments, auth, data mutations)8182### Step 6: Specify Dashboard Requirements8384Define dashboard hierarchy:85- **Operational dashboards**: Service health overview, real-time traffic, error rates, latency percentiles86- **Business dashboards**: User activity, feature adoption, conversion funnels, revenue metrics87- **SLO dashboards**: Error budget remaining, burn rate, SLO compliance history88- **Incident dashboards**: Pre-built investigation views for common failure modes89- Specify dashboard layout, refresh intervals, time range defaults, and access controls9091### Step 7: Define SLIs/SLOs9293Establish reliability targets:94- **Availability SLI**: Successful requests / total requests (define "successful")95- **Latency SLI**: Proportion of requests faster than threshold (p50, p95, p99 targets)96- **Error rate SLI**: Proportion of requests without errors (define "error")97- **SLO targets**: e.g., 99.9% availability, p95 latency < 200ms, error rate < 0.1%98- **Error budgets**: Calculate error budget from SLO, define burn rate alerts (fast burn, slow burn)99- **SLO review cadence**: Weekly error budget check, monthly SLO review, quarterly target adjustment100101> **Compaction resilience**: If context was lost during a long session, re-read the Inputs section to reconstruct what system is being analyzed, check the Progress Checklist for completed steps, then resume from the earliest incomplete step.102103## Output Format104105```markdown106# Observability Design: [Service/Feature Name]107108## Observability Architecture109110```111[Application] → [Metrics Agent] → [Metrics Store] → [Dashboards]112 ↓ ↓113[Structured Logs] → [Log Aggregator] → [Log Search] [Alerts] → [On-call]114 ↓115[Trace SDK] → [Trace Collector] → [Trace UI]116```117118## Metric Catalog119120| Metric Name | Type | Labels | Description | Alert Threshold |121|-------------|------|--------|-------------|-----------------|122| http_requests_total | counter | method, path, status | Request count | N/A |123| http_request_duration_ms | histogram | method, path | Request latency | p95 > 500ms |124| ... | ... | ... | ... | ... |125126## Alert Catalog127128| Alert Name | Severity | Condition | Duration | Runbook |129|------------|----------|-----------|----------|---------|130| HighErrorRate | critical | error_rate > 5% | 5m | [link] |131| LatencyDegraded | warning | p95 > 500ms | 10m | [link] |132| ... | ... | ... | ... | ... |133134## Logging Schema135136```json137{138 "timestamp": "ISO8601",139 "level": "INFO",140 "service": "api",141 "request_id": "uuid",142 "user_id": "string (optional)",143 "action": "string",144 "duration_ms": "number",145 "status": "number",146 "message": "string"147}148```149150## SLI/SLO Definitions151152| SLI | Measurement | SLO Target | Error Budget (30d) |153|-----|-------------|------------|-------------------|154| Availability | successful requests / total | 99.9% | 43.2 min downtime |155| Latency | requests < 200ms / total | 99.0% | 432 min slow |156| Error Rate | non-error requests / total | 99.9% | 0.1% errors |157158## Dashboard Specifications159160| Dashboard | Audience | Key Panels | Refresh |161|-----------|----------|------------|---------|162| Service Health | On-call | Traffic, errors, latency, saturation | 30s |163| SLO Status | Engineering | Error budget, burn rate, compliance | 5m |164| Business Metrics | Product | Adoption, conversions, revenue | 1h |165```166167## Handoff168169- Hand off to deployment-plan if observability findings reveal deployment pipeline gaps (e.g., missing health checks, no canary metrics integration).170- Hand off to cost-analysis if telemetry storage, metric cardinality, or log retention volumes raise infrastructure cost concerns.171172## Quality Checks173174- [ ] All three observability pillars (metrics, logs, traces) are covered175- [ ] Every alert has a defined severity, threshold, and linked runbook176- [ ] Structured logging schema includes correlation IDs for distributed tracing177- [ ] PII fields are identified with redaction strategy178- [ ] SLIs are measurable and SLO targets are realistic for the service tier179- [ ] Error budgets are calculated with burn rate alert thresholds180- [ ] Dashboard hierarchy covers operational, business, and SLO views181- [ ] Sampling strategy balances trace coverage with storage costs182183## Evolution Notes184<!-- Observations appended after each use -->185186---187> Converted and distributed by [TomeVault](https://tomevault.io/claim/dtsong) — claim your Tome and manage your conversions.188<!-- tomevault:4.0:skill_md:2026-04-13 -->