Senior Observability
Complete toolkit for senior observability engineering with modern monitoring, logging, tracing, and alerting best practices.
Overview
This skill provides comprehensive observability capabilities through four core Python automation tools and extensive reference documentation. Whether implementing monitoring stacks, designing alerting strategies, setting up distributed tracing, or defining SLO frameworks, this skill delivers production-ready observability solutions.
Senior observability engineers use this skill for metrics collection (Prometheus, DataDog, CloudWatch, NewRelic), visualization (Grafana dashboards, NewRelic Dashboards), distributed tracing (OpenTelemetry, Jaeger), centralized logging (ELK Stack, Loki, NewRelic Logs), and alerting (AlertManager, PagerDuty, NewRelic Alerts). The skill covers the Four Golden Signals, RED/USE methods, SLI/SLO frameworks, and incident response patterns.
Core Value: Reduce mean-time-to-detection (MTTD) by 60%+ and mean-time-to-resolution (MTTR) by 40%+ while improving system reliability through comprehensive observability practices and automated tooling.
Quick Start
Main Capabilities
This skill provides four core capabilities through automated scripts:
# Script 1: Dashboard Generator - Create Grafana/DataDog dashboards
python3 scripts/dashboard_generator.py --service my-api --type api --platform grafana --output json
# Script 2: Alert Rule Generator - Create Prometheus/DataDog alert rules
python3 scripts/alert_rule_generator.py --service my-api --slo-target 99.9 --platform prometheus --output yaml
# Script 3: SLO Calculator - Calculate error budgets and burn rates
python3 scripts/slo_calculator.py --input metrics.csv --slo-type availability --target 99.9 --output json
# Script 4: Metrics Analyzer - Analyze patterns, anomalies, and trends
python3 scripts/metrics_analyzer.py --input metrics.csv --analysis-type anomaly --output json
Core Capabilities
- Dashboard Generation - Grafana, DataDog, CloudWatch, and NewRelic dashboards with RED/USE method panels, resource metrics, and variable templating
- Alert Rule Creation - Prometheus AlertManager, DataDog, CloudWatch, NewRelic, and PagerDuty alert rules with SLO-based multi-burn-rate alerting
- SLO Framework - SLI definition, SLO target calculation, error budget tracking, and burn rate analysis
- Metrics Analysis - Baseline calculation, anomaly detection, trend analysis, and cardinality optimization
- Distributed Tracing - OpenTelemetry instrumentation patterns, Jaeger/Tempo configuration, and trace analysis
- Centralized Logging - Structured logging patterns, ELK Stack/Loki architecture, and log correlation
Python Tools
1. Dashboard Generator
Generate production-ready dashboard configurations for Grafana, DataDog, or CloudWatch.
Usage:
python3 scripts/dashboard_generator.py \
--service "payment-api" \
--type api \
--platform grafana \
--output json \
--file dashboards/payment-api.json
Arguments:
--service / -s: Service name (required)
--type / -t: Service type - api, database, queue, cache, web (default: api)
--platform / -p: Target platform - grafana, datadog, cloudwatch, newrelic (default: grafana)
--output / -o: Output format - json, yaml, text (default: text)
--file / -f: Write output to file
--verbose / -v: Enable verbose output
Features:
- RED method panels (Request rate, Error rate, Duration percentiles)
- USE method panels (Utilization, Saturation, Errors)
- Resource metrics (CPU, memory, disk, network)
- Variable templating for multi-service dashboards
- Annotations for deployments and incidents
- Threshold configurations for visual alerts
2. Alert Rule Generator
Generate alerting rules for Prometheus AlertManager, DataDog, CloudWatch, NewRelic, or PagerDuty.
Usage:
python3 scripts/alert_rule_generator.py \
--service "payment-api" \
--slo-target 99.9 \
--platform prometheus \
--severity critical,warning \
--output yaml \
--file alerts/payment-api.yaml
Arguments:
--service / -s: Service name (required)
--slo-target: SLO availability target percentage (default: 99.9)
--platform / -p: Target platform - prometheus, datadog, cloudwatch, newrelic, pagerduty (default: prometheus)
--severity: Severity levels to generate - critical, warning, info (default: critical,warning)
--output / -o: Output format - yaml, json, text (default: yaml)
--file / -f: Write output to file
--runbook-url: Base URL for runbook links
--verbose / -v: Enable verbose output
Features:
- SLO-based alerting (error budget consumption rates)
- Multi-window, multi-burn-rate alerting patterns
- Alert severity classification with escalation
- Runbook link generation
- Inhibition rules to reduce alert noise
3. SLO Calculator
Calculate SLI/SLO targets, error budgets, and burn rates from metrics data.
Usage:
python3 scripts/slo_calculator.py \
--input metrics.csv \
--slo-type availability \
--target 99.9 \
--window 30d \
--output json \
--file slo-report.json
Arguments:
--input / -i: Input metrics file (CSV or JSON) (required)
--slo-type: Type of SLO - availability, latency, throughput (default: availability)
--target: SLO target percentage (default: 99.9)
--window: Time window - 7d, 30d, 90d (default: 30d)
--output / -o: Output format - json, text, markdown, csv (default: text)
--file / -f: Write output to file
--verbose / -v: Enable verbose output
Features:
- SLI calculation from raw metrics (success rate, latency percentiles)
- Error budget calculation (total, consumed, remaining)
- Multi-window burn rate analysis (1h, 6h, 24h, 3d)
- SLO recommendations based on historical performance
- Alert threshold suggestions based on error budget
4. Metrics Analyzer
Analyze metrics patterns to detect anomalies, trends, and optimization opportunities.
Usage:
python3 scripts/metrics_analyzer.py \
--input metrics.csv \
--analysis-type anomaly \
--metrics http_requests_total,http_request_duration_seconds \
--threshold 3.0 \
--output json \
--file analysis-report.json
Arguments:
--input / -i: Input metrics file (CSV or JSON) (required)
--analysis-type: Analysis type - anomaly, trend, correlation, baseline, cardinality (default: anomaly)
--metrics: Comma-separated metric names to analyze (optional, analyzes all if not specified)
--threshold: Anomaly detection threshold in standard deviations (default: 3.0)
--output / -o: Output format - json, text, markdown, csv (default: text)
--file / -f: Write output to file
--verbose / -v: Enable verbose output
Features:
- Statistical baseline calculation (mean, median, percentiles, std dev)
- Anomaly detection using Z-score and IQR methods
- Trend analysis (increasing, decreasing, stable, seasonal)
- Correlation analysis between metrics
- Cardinality analysis for high-cardinality metric optimization
- Actionable recommendations for metric improvements
Reference Documentation
1. Monitoring Patterns (references/monitoring_patterns.md)
Comprehensive guide to metrics collection and visualization patterns:
- Four Golden Signals (Latency, Traffic, Errors, Saturation)
- RED Method (Rate, Errors, Duration) for request-driven services
- USE Method (Utilization, Saturation, Errors) for resources
- Platform-specific patterns (Prometheus, DataDog, CloudWatch, NewRelic)
- Metric naming conventions and labeling best practices
- Cardinality management and optimization
2. NewRelic Patterns (references/newrelic_patterns.md)
Complete NewRelic observability guide:
- NRQL query language syntax and best practices
- Four Golden Signals in NRQL (Transaction, SystemSample events)
- RED/USE method queries for NewRelic
- Dashboard widget types and configuration
- Alert condition types (NRQL, baseline, outlier)
- Service Level Management for SLIs/SLOs
- Kubernetes integration with nri-bundle
- PromQL to NRQL translation patterns
3. Logging Architecture (references/logging_architecture.md)
Complete logging strategy and implementation guide:
- Structured logging formats (JSON, key-value)
- Log levels and their appropriate usage
- ELK Stack architecture and configuration
- Loki/Grafana logging patterns
- Log aggregation strategies (sidecar, DaemonSet)
- Correlation IDs and distributed request tracing
- Log retention policies and cost optimization
4. Distributed Tracing (references/distributed_tracing.md)
End-to-end distributed tracing implementation:
- OpenTelemetry standards and instrumentation
- Trace context propagation patterns
- Jaeger and Tempo backend configuration
- Sampling strategies (head-based, tail-based, adaptive)
- Critical path analysis and bottleneck identification
- Service dependency mapping
- Performance overhead management
5. Alerting and Runbooks (references/alerting_runbooks.md)
Alerting strategy and incident response patterns:
- Symptom-based vs cause-based alerting
- SLI/SLO/SLA framework implementation
- Multi-window, multi-burn-rate alerting
- Alert fatigue prevention strategies
- Runbook structure and best practices
- Escalation policies and on-call rotation
- Incident response integration
Asset Templates
Dashboard Templates (assets/dashboard_templates/)
Pre-built Grafana dashboard JSON templates:
api_service_dashboard.json - RED method dashboard for API services
database_dashboard.json - USE method dashboard for databases
kubernetes_dashboard.json - Cluster and workload metrics
slo_overview_dashboard.json - Error budget and SLO tracking
NewRelic Dashboard Templates:
newrelic_service_overview.json - RED method dashboard with NRQL queries
newrelic_slo_dashboard.json - SLO tracking with burn rate visualization
Alert Templates (assets/alert_templates/)
Production-ready alert rule templates:
availability_alerts.yaml - Service availability alerts
latency_alerts.yaml - Latency percentile alerts
resource_alerts.yaml - CPU, memory, disk alerts
slo_burn_rate_alerts.yaml - Multi-window burn rate alerts
NewRelic Alert Templates:
newrelic_slo_alerts.json - Multi-burn-rate NRQL alert conditions
newrelic_infrastructure_alerts.json - CPU, memory, disk, container alerts
Runbook Template (assets/runbook_template.md)
Standardized incident response runbook format with sections for alert context, diagnostic steps, remediation actions, and escalation criteria.
Key Workflows
Workflow 1: Full Observability Stack Implementation
Goal: Deploy comprehensive observability infrastructure for microservices.
Duration: 4-6 hours
Steps:
- Analyze service architecture and identify observability requirements
- Deploy Prometheus with ServiceMonitor configurations
- Generate Grafana dashboards using
dashboard_generator.py
- Configure centralized logging with Loki or ELK
- Deploy Jaeger for distributed tracing
- Set up AlertManager with
alert_rule_generator.py
- Validate end-to-end observability flow
Workflow 2: SLI/SLO Framework Definition
Goal: Define Service Level Indicators and Objectives with error budget policies.
Duration: 2-3 hours
Steps:
- Identify critical user journeys and service boundaries
- Calculate baseline metrics using
slo_calculator.py
- Define SLIs for availability, latency, and throughput
- Set SLO targets based on service tier and business requirements
- Configure multi-burn-rate alerting rules
- Create SLO dashboard for error budget tracking
- Document error budget policies and escalation procedures
Workflow 3: Alert Design and Runbook Creation
Goal: Design symptom-based alerting with comprehensive runbooks.
Duration: 3-4 hours
Steps:
- Audit existing alerts for noise and gaps
- Generate optimized alert rules using
alert_rule_generator.py
- Create runbook templates for each alert type
- Configure escalation policies and notification channels
- Test alert firing and notification delivery
- Document on-call procedures and handoff protocols
Workflow 4: Dashboard Design for Service Health
Goal: Create comprehensive dashboards using RED/USE methodologies.
Duration: 2-3 hours
Steps:
- Define dashboard requirements per service type
- Generate dashboard configurations using
dashboard_generator.py
- Add variable templating for multi-service views
- Configure annotations for deployments and incidents
- Set up dashboard provisioning for GitOps workflows
- Document dashboard usage and interpretation
Best Practices Summary
Monitoring
- Instrument the Four Golden Signals for every service
- Use RED method for request-driven services, USE method for resources
- Maintain metric cardinality below 10,000 series per service
- Set appropriate scrape intervals (15-30s for most metrics)
Logging
- Use structured JSON logging for machine parseability
- Include correlation IDs in all log entries
- Log at appropriate levels (ERROR for failures, INFO for state changes)
- Implement log sampling for high-volume debug logs
Tracing
- Instrument 100% of entry points, sample at collection
- Propagate trace context across all service boundaries
- Use tail-based sampling for error and slow traces
- Keep trace retention to 7-14 days for cost management
Alerting
- Alert on symptoms (user-facing impact), not causes
- Use multi-window burn rates for SLO-based alerting
- Maintain 1:1 ratio of alerts to runbooks
- Review alert noise monthly and tune thresholds
Common Commands
# Generate API service dashboard (Grafana)
python3 scripts/dashboard_generator.py -s my-api -t api -p grafana -o json
# Generate API service dashboard (NewRelic)
python3 scripts/dashboard_generator.py -s my-api -t api -p newrelic -o json
# Generate database dashboard
python3 scripts/dashboard_generator.py -s my-db -t database -p grafana -o json
# Create SLO-based alerts for 99.9% availability (Prometheus)
python3 scripts/alert_rule_generator.py -s my-api --slo-target 99.9 -p prometheus -o yaml
# Create SLO-based alerts for 99.9% availability (NewRelic)
python3 scripts/alert_rule_generator.py -s my-api --slo-target 99.9 -p newrelic -o json
# Calculate error budget from metrics export
python3 scripts/slo_calculator.py -i prometheus_export.csv --target 99.9 --window 30d -o markdown
# Detect anomalies in latency metrics
python3 scripts/metrics_analyzer.py -i metrics.csv --analysis-type anomaly --threshold 3.0 -o json
# Analyze metric cardinality
python3 scripts/metrics_analyzer.py -i metrics.csv --analysis-type cardinality -o text
Troubleshooting
High Cardinality Metrics
Problem: Prometheus memory usage growing, queries timing out
Solution: Use metrics_analyzer.py --analysis-type cardinality to identify high-cardinality labels, then aggregate or drop unnecessary labels
Alert Fatigue
Problem: Too many alerts, on-call burnout
Solution: Implement multi-burn-rate alerting using alert_rule_generator.py, add inhibition rules, increase alert thresholds for non-critical services
Missing Traces
Problem: Traces not connecting across services
Solution: Verify trace context propagation headers (traceparent, W3C format), check sampling configuration, ensure OpenTelemetry collector is receiving spans
Dashboard Performance
Problem: Grafana dashboards loading slowly
Solution: Use recording rules for expensive queries, reduce time range defaults, add query caching, limit panel count per dashboard
Resources
1---2name: senior-observability3description: Comprehensive observability skill for monitoring, logging, distributed tracing, alerting, and SLI/SLO implementation across distributed systems. Includes dashboard generation, alert rule creation, error budget calculation, and metrics analysis. Use when implementing monitoring stacks, designing alerting strategies, setting up distributed tracing, or defining SLO frameworks.4license: MIT5---6
7
8# Senior Observability
9
10Complete toolkit for senior observability engineering with modern monitoring, logging, tracing, and alerting best practices.
11
12## Overview
13
14This skill provides comprehensive observability capabilities through four core Python automation tools and extensive reference documentation. Whether implementing monitoring stacks, designing alerting strategies, setting up distributed tracing, or defining SLO frameworks, this skill delivers production-ready observability solutions.
15
16Senior observability engineers use this skill for metrics collection (Prometheus, DataDog, CloudWatch, **NewRelic**), visualization (Grafana dashboards, **NewRelic Dashboards**), distributed tracing (OpenTelemetry, Jaeger), centralized logging (ELK Stack, Loki, **NewRelic Logs**), and alerting (AlertManager, PagerDuty, **NewRelic Alerts**). The skill covers the Four Golden Signals, RED/USE methods, SLI/SLO frameworks, and incident response patterns.
17
18**Core Value:** Reduce mean-time-to-detection (MTTD) by 60%+ and mean-time-to-resolution (MTTR) by 40%+ while improving system reliability through comprehensive observability practices and automated tooling.
19
20## Quick Start
21
22### Main Capabilities
23
24This skill provides four core capabilities through automated scripts:
25
26```bash
27# Script 1: Dashboard Generator - Create Grafana/DataDog dashboards
28python3 scripts/dashboard_generator.py --service my-api --type api --platform grafana --output json
29
30# Script 2: Alert Rule Generator - Create Prometheus/DataDog alert rules
31python3 scripts/alert_rule_generator.py --service my-api --slo-target 99.9 --platform prometheus --output yaml
32
33# Script 3: SLO Calculator - Calculate error budgets and burn rates
34python3 scripts/slo_calculator.py --input metrics.csv --slo-type availability --target 99.9 --output json
35
36# Script 4: Metrics Analyzer - Analyze patterns, anomalies, and trends
37python3 scripts/metrics_analyzer.py --input metrics.csv --analysis-type anomaly --output json
38```
39
40## Core Capabilities
41
42- **Dashboard Generation** - Grafana, DataDog, CloudWatch, and **NewRelic** dashboards with RED/USE method panels, resource metrics, and variable templating
43- **Alert Rule Creation** - Prometheus AlertManager, DataDog, CloudWatch, **NewRelic**, and PagerDuty alert rules with SLO-based multi-burn-rate alerting
44- **SLO Framework** - SLI definition, SLO target calculation, error budget tracking, and burn rate analysis
45- **Metrics Analysis** - Baseline calculation, anomaly detection, trend analysis, and cardinality optimization
46- **Distributed Tracing** - OpenTelemetry instrumentation patterns, Jaeger/Tempo configuration, and trace analysis
47- **Centralized Logging** - Structured logging patterns, ELK Stack/Loki architecture, and log correlation
48
49## Python Tools
50
51### 1. Dashboard Generator
52
53Generate production-ready dashboard configurations for Grafana, DataDog, or CloudWatch.
54
55**Usage:**
56```bash
57python3 scripts/dashboard_generator.py \
58 --service "payment-api" \
59 --type api \
60 --platform grafana \
61 --output json \
62 --file dashboards/payment-api.json
63```
64
65**Arguments:**
66- `--service` / `-s`: Service name (required)
67- `--type` / `-t`: Service type - api, database, queue, cache, web (default: api)
68- `--platform` / `-p`: Target platform - grafana, datadog, cloudwatch, **newrelic** (default: grafana)
69- `--output` / `-o`: Output format - json, yaml, text (default: text)
70- `--file` / `-f`: Write output to file
71- `--verbose` / `-v`: Enable verbose output
72
73**Features:**
74- RED method panels (Request rate, Error rate, Duration percentiles)
75- USE method panels (Utilization, Saturation, Errors)
76- Resource metrics (CPU, memory, disk, network)
77- Variable templating for multi-service dashboards
78- Annotations for deployments and incidents
79- Threshold configurations for visual alerts
80
81### 2. Alert Rule Generator
82
83Generate alerting rules for Prometheus AlertManager, DataDog, CloudWatch, NewRelic, or PagerDuty.
84
85**Usage:**
86```bash
87python3 scripts/alert_rule_generator.py \
88 --service "payment-api" \
89 --slo-target 99.9 \
90 --platform prometheus \
91 --severity critical,warning \
92 --output yaml \
93 --file alerts/payment-api.yaml
94```
95
96**Arguments:**
97- `--service` / `-s`: Service name (required)
98- `--slo-target`: SLO availability target percentage (default: 99.9)
99- `--platform` / `-p`: Target platform - prometheus, datadog, cloudwatch, **newrelic**, pagerduty (default: prometheus)
100- `--severity`: Severity levels to generate - critical, warning, info (default: critical,warning)
101- `--output` / `-o`: Output format - yaml, json, text (default: yaml)
102- `--file` / `-f`: Write output to file
103- `--runbook-url`: Base URL for runbook links
104- `--verbose` / `-v`: Enable verbose output
105
106**Features:**
107- SLO-based alerting (error budget consumption rates)
108- Multi-window, multi-burn-rate alerting patterns
109- Alert severity classification with escalation
110- Runbook link generation
111- Inhibition rules to reduce alert noise
112
113### 3. SLO Calculator
114
115Calculate SLI/SLO targets, error budgets, and burn rates from metrics data.
116
117**Usage:**
118```bash
119python3 scripts/slo_calculator.py \
120 --input metrics.csv \
121 --slo-type availability \
122 --target 99.9 \
123 --window 30d \
124 --output json \
125 --file slo-report.json
126```
127
128**Arguments:**
129- `--input` / `-i`: Input metrics file (CSV or JSON) (required)
130- `--slo-type`: Type of SLO - availability, latency, throughput (default: availability)
131- `--target`: SLO target percentage (default: 99.9)
132- `--window`: Time window - 7d, 30d, 90d (default: 30d)
133- `--output` / `-o`: Output format - json, text, markdown, csv (default: text)
134- `--file` / `-f`: Write output to file
135- `--verbose` / `-v`: Enable verbose output
136
137**Features:**
138- SLI calculation from raw metrics (success rate, latency percentiles)
139- Error budget calculation (total, consumed, remaining)
140- Multi-window burn rate analysis (1h, 6h, 24h, 3d)
141- SLO recommendations based on historical performance
142- Alert threshold suggestions based on error budget
143
144### 4. Metrics Analyzer
145
146Analyze metrics patterns to detect anomalies, trends, and optimization opportunities.
147
148**Usage:**
149```bash
150python3 scripts/metrics_analyzer.py \
151 --input metrics.csv \
152 --analysis-type anomaly \
153 --metrics http_requests_total,http_request_duration_seconds \
154 --threshold 3.0 \
155 --output json \
156 --file analysis-report.json
157```
158
159**Arguments:**
160- `--input` / `-i`: Input metrics file (CSV or JSON) (required)
161- `--analysis-type`: Analysis type - anomaly, trend, correlation, baseline, cardinality (default: anomaly)
162- `--metrics`: Comma-separated metric names to analyze (optional, analyzes all if not specified)
163- `--threshold`: Anomaly detection threshold in standard deviations (default: 3.0)
164- `--output` / `-o`: Output format - json, text, markdown, csv (default: text)
165- `--file` / `-f`: Write output to file
166- `--verbose` / `-v`: Enable verbose output
167
168**Features:**
169- Statistical baseline calculation (mean, median, percentiles, std dev)
170- Anomaly detection using Z-score and IQR methods
171- Trend analysis (increasing, decreasing, stable, seasonal)
172- Correlation analysis between metrics
173- Cardinality analysis for high-cardinality metric optimization
174- Actionable recommendations for metric improvements
175
176## Reference Documentation
177
178### 1. Monitoring Patterns (`references/monitoring_patterns.md`)
179
180Comprehensive guide to metrics collection and visualization patterns:
181- Four Golden Signals (Latency, Traffic, Errors, Saturation)
182- RED Method (Rate, Errors, Duration) for request-driven services
183- USE Method (Utilization, Saturation, Errors) for resources
184- Platform-specific patterns (Prometheus, DataDog, CloudWatch, **NewRelic**)
185- Metric naming conventions and labeling best practices
186- Cardinality management and optimization
187
188### 2. NewRelic Patterns (`references/newrelic_patterns.md`)
189
190Complete NewRelic observability guide:
191- NRQL query language syntax and best practices
192- Four Golden Signals in NRQL (Transaction, SystemSample events)
193- RED/USE method queries for NewRelic
194- Dashboard widget types and configuration
195- Alert condition types (NRQL, baseline, outlier)
196- Service Level Management for SLIs/SLOs
197- Kubernetes integration with nri-bundle
198- PromQL to NRQL translation patterns
199
200### 3. Logging Architecture (`references/logging_architecture.md`)
201
202Complete logging strategy and implementation guide:
203- Structured logging formats (JSON, key-value)
204- Log levels and their appropriate usage
205- ELK Stack architecture and configuration
206- Loki/Grafana logging patterns
207- Log aggregation strategies (sidecar, DaemonSet)
208- Correlation IDs and distributed request tracing
209- Log retention policies and cost optimization
210
211### 4. Distributed Tracing (`references/distributed_tracing.md`)
212
213End-to-end distributed tracing implementation:
214- OpenTelemetry standards and instrumentation
215- Trace context propagation patterns
216- Jaeger and Tempo backend configuration
217- Sampling strategies (head-based, tail-based, adaptive)
218- Critical path analysis and bottleneck identification
219- Service dependency mapping
220- Performance overhead management
221
222### 5. Alerting and Runbooks (`references/alerting_runbooks.md`)
223
224Alerting strategy and incident response patterns:
225- Symptom-based vs cause-based alerting
226- SLI/SLO/SLA framework implementation
227- Multi-window, multi-burn-rate alerting
228- Alert fatigue prevention strategies
229- Runbook structure and best practices
230- Escalation policies and on-call rotation
231- Incident response integration
232
233## Asset Templates
234
235### Dashboard Templates (`assets/dashboard_templates/`)
236
237Pre-built Grafana dashboard JSON templates:
238- `api_service_dashboard.json` - RED method dashboard for API services
239- `database_dashboard.json` - USE method dashboard for databases
240- `kubernetes_dashboard.json` - Cluster and workload metrics
241- `slo_overview_dashboard.json` - Error budget and SLO tracking
242
243**NewRelic Dashboard Templates:**
244- `newrelic_service_overview.json` - RED method dashboard with NRQL queries
245- `newrelic_slo_dashboard.json` - SLO tracking with burn rate visualization
246
247### Alert Templates (`assets/alert_templates/`)
248
249Production-ready alert rule templates:
250- `availability_alerts.yaml` - Service availability alerts
251- `latency_alerts.yaml` - Latency percentile alerts
252- `resource_alerts.yaml` - CPU, memory, disk alerts
253- `slo_burn_rate_alerts.yaml` - Multi-window burn rate alerts
254
255**NewRelic Alert Templates:**
256- `newrelic_slo_alerts.json` - Multi-burn-rate NRQL alert conditions
257- `newrelic_infrastructure_alerts.json` - CPU, memory, disk, container alerts
258
259### Runbook Template (`assets/runbook_template.md`)
260
261Standardized incident response runbook format with sections for alert context, diagnostic steps, remediation actions, and escalation criteria.
262
263## Key Workflows
264
265### Workflow 1: Full Observability Stack Implementation
266
267**Goal:** Deploy comprehensive observability infrastructure for microservices.
268
269**Duration:** 4-6 hours
270
271**Steps:**
2721. Analyze service architecture and identify observability requirements
2732. Deploy Prometheus with ServiceMonitor configurations
2743. Generate Grafana dashboards using `dashboard_generator.py`
2754. Configure centralized logging with Loki or ELK
2765. Deploy Jaeger for distributed tracing
2776. Set up AlertManager with `alert_rule_generator.py`
2787. Validate end-to-end observability flow
279
280### Workflow 2: SLI/SLO Framework Definition
281
282**Goal:** Define Service Level Indicators and Objectives with error budget policies.
283
284**Duration:** 2-3 hours
285
286**Steps:**
2871. Identify critical user journeys and service boundaries
2882. Calculate baseline metrics using `slo_calculator.py`
2893. Define SLIs for availability, latency, and throughput
2904. Set SLO targets based on service tier and business requirements
2915. Configure multi-burn-rate alerting rules
2926. Create SLO dashboard for error budget tracking
2937. Document error budget policies and escalation procedures
294
295### Workflow 3: Alert Design and Runbook Creation
296
297**Goal:** Design symptom-based alerting with comprehensive runbooks.
298
299**Duration:** 3-4 hours
300
301**Steps:**
3021. Audit existing alerts for noise and gaps
3032. Generate optimized alert rules using `alert_rule_generator.py`
3043. Create runbook templates for each alert type
3054. Configure escalation policies and notification channels
3065. Test alert firing and notification delivery
3076. Document on-call procedures and handoff protocols
308
309### Workflow 4: Dashboard Design for Service Health
310
311**Goal:** Create comprehensive dashboards using RED/USE methodologies.
312
313**Duration:** 2-3 hours
314
315**Steps:**
3161. Define dashboard requirements per service type
3172. Generate dashboard configurations using `dashboard_generator.py`
3183. Add variable templating for multi-service views
3194. Configure annotations for deployments and incidents
3205. Set up dashboard provisioning for GitOps workflows
3216. Document dashboard usage and interpretation
322
323## Best Practices Summary
324
325### Monitoring
326- Instrument the Four Golden Signals for every service
327- Use RED method for request-driven services, USE method for resources
328- Maintain metric cardinality below 10,000 series per service
329- Set appropriate scrape intervals (15-30s for most metrics)
330
331### Logging
332- Use structured JSON logging for machine parseability
333- Include correlation IDs in all log entries
334- Log at appropriate levels (ERROR for failures, INFO for state changes)
335- Implement log sampling for high-volume debug logs
336
337### Tracing
338- Instrument 100% of entry points, sample at collection
339- Propagate trace context across all service boundaries
340- Use tail-based sampling for error and slow traces
341- Keep trace retention to 7-14 days for cost management
342
343### Alerting
344- Alert on symptoms (user-facing impact), not causes
345- Use multi-window burn rates for SLO-based alerting
346- Maintain 1:1 ratio of alerts to runbooks
347- Review alert noise monthly and tune thresholds
348
349## Common Commands
350
351```bash
352# Generate API service dashboard (Grafana)
353python3 scripts/dashboard_generator.py -s my-api -t api -p grafana -o json
354
355# Generate API service dashboard (NewRelic)
356python3 scripts/dashboard_generator.py -s my-api -t api -p newrelic -o json
357
358# Generate database dashboard
359python3 scripts/dashboard_generator.py -s my-db -t database -p grafana -o json
360
361# Create SLO-based alerts for 99.9% availability (Prometheus)
362python3 scripts/alert_rule_generator.py -s my-api --slo-target 99.9 -p prometheus -o yaml
363
364# Create SLO-based alerts for 99.9% availability (NewRelic)
365python3 scripts/alert_rule_generator.py -s my-api --slo-target 99.9 -p newrelic -o json
366
367# Calculate error budget from metrics export
368python3 scripts/slo_calculator.py -i prometheus_export.csv --target 99.9 --window 30d -o markdown
369
370# Detect anomalies in latency metrics
371python3 scripts/metrics_analyzer.py -i metrics.csv --analysis-type anomaly --threshold 3.0 -o json
372
373# Analyze metric cardinality
374python3 scripts/metrics_analyzer.py -i metrics.csv --analysis-type cardinality -o text
375```
376
377## Troubleshooting
378
379### High Cardinality Metrics
380**Problem:** Prometheus memory usage growing, queries timing out
381**Solution:** Use `metrics_analyzer.py --analysis-type cardinality` to identify high-cardinality labels, then aggregate or drop unnecessary labels
382
383### Alert Fatigue
384**Problem:** Too many alerts, on-call burnout
385**Solution:** Implement multi-burn-rate alerting using `alert_rule_generator.py`, add inhibition rules, increase alert thresholds for non-critical services
386
387### Missing Traces
388**Problem:** Traces not connecting across services
389**Solution:** Verify trace context propagation headers (traceparent, W3C format), check sampling configuration, ensure OpenTelemetry collector is receiving spans
390
391### Dashboard Performance
392**Problem:** Grafana dashboards loading slowly
393**Solution:** Use recording rules for expensive queries, reduce time range defaults, add query caching, limit panel count per dashboard
394
395## Resources
396
397- [Monitoring Patterns Reference](references/monitoring_patterns.md)
398- [NewRelic Patterns Reference](references/newrelic_patterns.md)
399- [Logging Architecture Reference](references/logging_architecture.md)
400- [Distributed Tracing Reference](references/distributed_tracing.md)
401- [Alerting and Runbooks Reference](references/alerting_runbooks.md)
402- [Google SRE Book - Monitoring Distributed Systems](https://sre.google/sre-book/monitoring-distributed-systems/)
403- [OpenTelemetry Documentation](https://opentelemetry.io/docs/)
404- [Prometheus Best Practices](https://prometheus.io/docs/practices/)
405- [NewRelic NRQL Documentation](https://docs.newrelic.com/docs/nrql/get-started/introduction-nrql-new-relics-query-language/)