Purpose & When-To-Use
Purpose: Design comprehensive observability dashboards that unify metrics, logs, and traces using the Four Golden Signals framework (Latency, Traffic, Errors, Saturation), automate correlations across telemetry signals via OpenTelemetry, track SLO compliance, and configure Grafana 11 with automatic drill-down from alerts to root cause.
When to Use:
- You need a single pane of glass for monitoring distributed systems (microservices, cloud-native apps).
- You want to implement SRE best practices (Golden Signals, SLO tracking, error budget management).
- You have multiple telemetry sources (Prometheus, Loki, Tempo, Jaeger, CloudWatch, Datadog) and need unified visibility.
- You need automatic correlation from high-level metrics (latency spike) → detailed logs (error messages) → distributed traces (slow span).
- You're migrating from tool-specific dashboards (separate Prometheus/Grafana, ELK, Jaeger UIs) to a unified platform.
- You require real-time SLO compliance tracking with burn rate alerts.
Orchestrates:
observability-slo-calculator: Computes SLO compliance, error budgets, and burn rates.
observability-stack-configurator: Deploys Prometheus, Loki, Tempo, Grafana stack.
Complements:
database-postgres-architect, database-mongodb-architect, database-redis-architect: Adds database-specific metrics (query latency, cache hit rate).
cloud-kubernetes-architect: Integrates k8s metrics (pod restarts, resource saturation).
Pre-Checks
Mandatory Inputs:
services: List of services/systems to monitor (≥1). Each service should have a unique service.name (OpenTelemetry resource attribute).
telemetry_sources: At least one data source for metrics (e.g., Prometheus), logs (e.g., Loki), or traces (e.g., Tempo).
deployment_env: Environment context to filter data (production, staging, dev).
Validation Steps:
- Compute NOW_ET using NIST time.gov semantics (America/New_York, ISO-8601) for timestamp anchoring.
- Check telemetry_sources accessibility: Verify endpoints are reachable (HTTP 200 for Prometheus
/api/v1/status/config, Loki /ready, Tempo /ready).
- Verify OpenTelemetry instrumentation: Confirm services emit OTLP (OpenTelemetry Protocol) data with
trace_id and span_id propagation.
- Validate SLO targets format: If provided, ensure SLOs follow
<SLI> <comparator> <target> format (e.g., availability >= 99.9%, p95_latency < 200ms).
- Abort if:
- Zero telemetry sources configured.
- Services list is empty or lacks
service.name attributes.
- Data sources return 401 (authentication failure) or 404 (endpoint not found).
Procedure
T1: Quick Dashboard Setup (≤2k tokens, 80% use case)
Goal: Generate a minimal unified dashboard with the Four Golden Signals for a single service using existing Prometheus/Loki/Tempo data sources.
Steps:
- Identify primary service: Select the most critical service from
services list (or use first entry if priority not specified).
- Query telemetry sources for baseline metrics:
- Latency:
histogram_quantile(0.95, rate(http_request_duration_seconds_bucket{job="<service>"}[5m]))
- Traffic:
sum(rate(http_requests_total{job="<service>"}[5m]))
- Errors:
sum(rate(http_requests_total{job="<service>", status=~"5.."}[5m])) / sum(rate(http_requests_total{job="<service>"}[5m])) * 100
- Saturation:
avg(process_cpu_seconds_total{job="<service>"}) and avg(process_resident_memory_bytes{job="<service>"})
- Generate Grafana dashboard JSON:
- 4 panels (one per golden signal), arranged in a 2×2 grid.
- Time range: Last 1 hour (default).
- Refresh interval: 30 seconds.
- Add basic alert rule:
- Alert if error rate > 5% for 5 minutes (severity: warning).
- Output: Dashboard JSON + alert rule YAML (Grafana-managed alerting format).
Token Budget: ≤2k tokens (no deep SLO calculation, no complex correlation setup).
T2: Unified Dashboard with SLO Tracking (≤6k tokens)
Goal: Create a comprehensive dashboard with Golden Signals, SLO compliance tracking, automated correlations, and multi-service support.
Steps:
- Invoke
observability-slo-calculator (T2):
- Pass
slo_targets, services, and telemetry_sources (Prometheus for metrics, Loki for logs).
- Retrieve: SLO compliance %, error budget remaining, burn rate, time to exhaustion.
- Design multi-service dashboard:
- Overview panel: Table showing all services with current SLO status (✅ compliant, ⚠️ warning, ❌ breached).
- Per-service rows: Each service gets 4 golden signal panels + 1 SLO panel.
- Heatmap panel: Latency distribution across all services (percentiles: p50, p95, p99).
- Configure OpenTelemetry correlations:
- Metrics → Logs: Add correlation from Prometheus alert → Loki logs filtered by
service.name and trace_id.
- Logs → Traces: Add correlation from Loki log entry → Tempo trace lookup via
trace_id.
- Configuration: Use Grafana 11 Correlations API (
POST /api/datasources/uid/<uid>/correlations).
- Set up automated alert routing:
- Critical alerts (SLO burn rate > 14.4x, error rate > 10%): Route to PagerDuty.
- Warning alerts (SLO burn rate > 6x, error rate > 5%): Route to Slack.
- Info alerts (SLO trending toward breach in 7 days): Route to email.
- Generate OpenTelemetry Collector pipeline:
receivers:
otlp:
protocols:
grpc:
http:
processors:
batch:
timeout: 10s
send_batch_size: 1024
resource:
attributes:
- key: deployment.environment
value: ${DEPLOYMENT_ENV}
action: insert
exporters:
prometheus:
endpoint: "prometheus:9090"
loki:
endpoint: "http://loki:3100/loki/api/v1/push"
tempo:
endpoint: "tempo:4317"
service:
pipelines:
metrics:
receivers: [otlp]
processors: [batch, resource]
exporters: [prometheus]
logs:
receivers: [otlp]
processors: [batch, resource]
exporters: [loki]
traces:
receivers: [otlp]
processors: [batch, resource]
exporters: [tempo]
- Validation:
- Test correlation: Click Prometheus alert → verify Loki logs appear → click log line → verify Tempo trace opens.
- Test SLO tracking: Trigger synthetic error (increase 5xx responses) → confirm error budget decreases.
- Output:
- Dashboard JSON (multi-service, golden signals, SLO panels).
- Correlation rules JSON (3 rules: metrics→logs, logs→traces, traces→metrics).
- Alert rules YAML (5-10 rules based on golden signals + SLO burn rate).
- OpenTelemetry Collector config YAML.
- SLO summary report (current compliance, burn rate, time to exhaustion).
Token Budget: ≤6k tokens (includes SLO calculation delegation, correlation setup, multi-service config).
T3: Enterprise-Scale Dashboard with Advanced Features (≤12k tokens)
Goal: Deploy a production-grade unified observability platform with custom metrics, anomaly detection, capacity planning, and compliance reporting.
Steps:
- Invoke
observability-stack-configurator (T3):
- Deploy full stack (Prometheus, Loki, Tempo, Grafana 11) with HA (high availability).
- Configure persistent storage (retention: metrics 30 days, logs 90 days, traces 7 days).
- Extend dashboard with custom metrics:
- Business metrics: Order conversion rate, payment success rate, user signups/hour.
- Infrastructure metrics: Database query latency (PostgreSQL, MongoDB, Redis), cache hit rate, queue depth (Kafka, RabbitMQ).
- Security metrics: Failed login attempts, API rate limit hits, TLS certificate expiry countdown.
- Implement anomaly detection:
- Use Prometheus recording rules to compute baseline metrics (7-day moving average for latency, traffic).
- Alert on deviations:
abs(current_latency - baseline_latency) / baseline_latency > 0.3 (30% deviation).
- Capacity planning panel:
- Extrapolate resource usage (CPU, memory, disk) to predict when thresholds will be hit.
- Example: If disk usage grows at 2GB/day and 80GB free, alert "Disk full in 40 days."
- Compliance reporting:
- NIST SP 800-92 Log Management: Verify logs retained for required period (90 days), encrypted at rest.
- GDPR/CCPA: Ensure PII redaction in logs (email, IP addresses masked).
- Generate monthly compliance report: log retention status, encryption enabled, access audit trail.
- Advanced correlations:
- Traces → Metrics: From slow trace span → view aggregated latency metrics for that endpoint.
- Logs → Metrics: From error log → view error rate time series.
- Cross-service correlation: Link frontend error → backend API trace → database slow query log.
- Multi-environment dashboard:
- Separate panels for production, staging, dev environments.
- Environment selector variable (Grafana template variable) to toggle between envs.
- Generate comprehensive documentation:
- Runbook for common alerts (High error rate → check recent deployments, review logs, rollback if needed).
- Troubleshooting guide (Correlation not working → verify
trace_id propagation, check OTLP endpoints).
- Validation:
- Simulate production incident: Inject latency spike → verify anomaly detection alerts → follow correlation chain → confirm root cause identified.
- Audit compliance: Run GDPR compliance check → verify PII redacted, logs encrypted.
- Output:
- Multi-environment dashboard JSON (production, staging, dev).
- 20+ alert rules (golden signals + SLO + anomaly detection + capacity planning).
- OpenTelemetry Collector config with advanced processors (attributes, tail sampling, span metrics).
- Compliance report (log retention, encryption status, PII redaction confirmation).
- Runbook documentation (5-10 common scenarios with resolution steps).
Token Budget: ≤12k tokens (includes stack deployment, advanced analytics, compliance checks, documentation).
Decision Rules
Ambiguity Resolution:
- If
slo_targets not provided:
- Use industry-standard defaults: 99.9% availability (3 nines), p95 latency < 500ms, error rate < 1%.
- Emit warning: "No SLO targets specified; using defaults. Review and adjust based on business requirements."
- If telemetry source lacks one signal type (e.g., no traces):
- Proceed with available signals (metrics + logs only).
- Emit note: "Tempo not configured; trace correlation unavailable. Install Tempo for full observability."
- If multiple services with same
service.name:
- Abort and request clarification: "Duplicate service names detected. Ensure unique
service.name attributes per service."
- If alert destinations not specified:
- Default to Grafana built-in alerting (notifications visible in Grafana UI only).
- Suggest: "Configure PagerDuty, Slack, or email for external alert routing."
Stop Conditions:
- Insufficient data: Telemetry sources return zero metrics/logs/traces for >5 minutes → abort with error: "No data from telemetry sources. Verify instrumentation and OTLP exporters."
- Authentication failure: All data sources return 401/403 → abort with error: "Authentication failed for telemetry sources. Check credentials and API tokens."
- Incompatible versions: Grafana version < 10.0 detected → warn: "Correlations require Grafana 11+. Upgrade recommended."
Thresholds:
- Golden Signal Alerts:
- Latency: p95 > 2× baseline for 5 minutes.
- Traffic: >50% drop from baseline for 5 minutes (potential outage).
- Errors: >5% error rate for 5 minutes.
- Saturation: CPU >80%, memory >85%, disk >90% for 5 minutes.
- SLO Burn Rate Alerts (Google SRE methodology):
- Critical: 14.4× burn rate (error budget exhausted in 2 days) → page immediately.
- Warning: 6× burn rate (error budget exhausted in 5 days) → notify team.
Output Contract
Required Fields:
{
dashboard_config: {
uid: string; // Grafana dashboard UID (unique identifier)
title: string; // Dashboard title (e.g., "Unified Observability: Production Services")
panels: Array<{ // Array of dashboard panels
id: number; // Panel ID (unique within dashboard)
title: string; // Panel title (e.g., "Latency (p95)")
type: string; // Panel type (graph, stat, table, heatmap)
targets: Array<{ // Data source queries
datasource: string; // Data source UID (Prometheus, Loki, Tempo)
expr: string; // Query expression (PromQL, LogQL, TraceQL)
}>;
alert?: { // Optional alert configuration
name: string; // Alert rule name
condition: string; // Alert condition (PromQL expression)
for: string; // Duration threshold (e.g., "5m")
annotations: {
summary: string; // Alert summary (e.g., "High error rate detected")
};
};
}>;
templating: { // Dashboard variables (environment, service selector)
list: Array<{
name: string; // Variable name (e.g., "environment")
type: string; // Variable type (query, custom, interval)
query: string; // Query to populate variable options
}>;
};
};
correlation_rules: Array<{ // Grafana correlations
source_datasource: string; // Source data source UID (e.g., Prometheus)
target_datasource: string; // Target data source UID (e.g., Loki)
label: string; // Correlation link label (e.g., "View Logs")
field: string; // Field to use for correlation (e.g., "trace_id")
transformation: string; // Optional transformation (e.g., regex extraction)
}>;
alert_rules: Array<{ // Alert definitions
name: string; // Alert rule name
expr: string; // PromQL expression for alert condition
for: string; // Duration threshold (e.g., "5m")
severity: "critical" | "warning" | "info";
annotations: {
summary: string; // Human-readable alert summary
runbook_url?: string; // Link to runbook for resolution steps
};
route?: { // Alert routing (optional)
receiver: string; // Receiver name (PagerDuty, Slack, email)
};
}>;
otel_pipeline: { // OpenTelemetry Collector configuration
receivers: object; // OTLP receivers (grpc, http)
processors: object; // Batch, resource, attributes processors
exporters: object; // Prometheus, Loki, Tempo exporters
service: {
pipelines: {
metrics: { receivers: string[]; processors: string[]; exporters: string[] };
logs: { receivers: string[]; processors: string[]; exporters: string[] };
traces: { receivers: string[]; processors: string[]; exporters: string[] };
};
};
};
slo_summary: { // SLO compliance report (from observability-slo-calculator)
services: Array<{
name: string; // Service name
slo_compliance: number; // Current SLO compliance (0-100%)
error_budget_remaining: number; // Error budget remaining (%)
burn_rate: number; // Current error budget burn rate (multiplier)
time_to_exhaustion_hours: number | null; // Hours until error budget exhausted (null if budget positive)
status: "compliant" | "warning" | "breached";
}>;
overall_compliance: number; // Average compliance across all services
};
}
Optional Fields:
custom_panels: Array of custom dashboard panels for business-specific metrics.
capacity_forecast: Object with resource usage predictions (disk full in X days, etc.).
compliance_report: Object with NIST SP 800-92, GDPR/CCPA compliance status.
runbook_links: Object mapping alert names to runbook URLs.
Format: JSON for dashboard_config, correlation_rules, otel_pipeline, slo_summary. YAML for alert_rules (Grafana-managed alerting format).
Examples
Example 1: E-commerce Platform Unified Dashboard (T2)
Input:
services:
- name: "frontend-web"
type: "web"
- name: "api-gateway"
type: "api"
- name: "order-service"
type: "backend"
deployment_env: "production"
slo_targets:
- service: "api-gateway"
availability: 99.95%
p95_latency_ms: 200
- service: "order-service"
availability: 99.9%
p95_latency_ms: 500
telemetry_sources:
metrics: "prometheus-prod"
logs: "loki-prod"
traces: "tempo-prod"
alert_destinations:
- type: "pagerduty"
integration_key: "REDACTED"
- type: "slack"
webhook_url: "REDACTED"
Output (T2 Summary):
Dashboard: "Unified Observability: E-commerce Production"
- Overview Panel: 3 services, 2/3 SLO compliant (order-service at 99.85%, warning)
- Golden Signals (per service):
api-gateway: Latency p95=150ms ✅, Traffic=1200 req/s, Errors=0.5% ✅, CPU=45%
order-service: Latency p95=480ms ✅, Traffic=300 req/s, Errors=2.1% ⚠️, CPU=78%
- Correlations: 3 rules (Prometheus alert → Loki logs → Tempo traces)
- Alerts:
- CRITICAL: order-service error rate >5% for 5m → PagerDuty
- WARNING: order-service SLO burn rate 7.2× (budget exhausted in 4 days) → Slack
OpenTelemetry Pipeline: OTLP receivers → batch processor → Prometheus/Loki/Tempo exporters
SLO Summary:
- api-gateway: 99.98% compliant (6% error budget remaining, burn rate 0.8×)
- order-service: 99.85% compliant (85% error budget consumed, burn rate 7.2× ⚠️)
- Overall: 99.92% compliance
Link to Full Example: See skills/observability-unified-dashboard/examples/ecommerce-unified-dashboard.txt
Example 2: Microservices Platform with Custom Metrics (T3 Snippet)
Custom Metrics Added:
- Payment success rate:
sum(rate(payment_transactions_total{status="success"}[5m])) / sum(rate(payment_transactions_total[5m])) * 100
- Database query latency:
histogram_quantile(0.95, rate(db_query_duration_seconds_bucket{db="orders"}[5m]))
- Cache hit rate:
sum(rate(redis_hits_total[5m])) / (sum(rate(redis_hits_total[5m])) + sum(rate(redis_misses_total[5m]))) * 100
Anomaly Detection Alert:
- alert: LatencyAnomalyDetected
expr: |
abs(
histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))
-
histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[7d] offset 7d))
) / histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[7d] offset 7d)) > 0.3
for: 10m
severity: warning
annotations:
summary: "Latency 30% higher than 7-day baseline"
runbook_url: "https://runbooks.example.com/latency-anomaly"
Quality Gates
Token Budget Compliance:
- T1 output ≤2k tokens (basic dashboard + 1 service).
- T2 output ≤6k tokens (multi-service dashboard + SLO tracking + correlations).
- T3 output ≤12k tokens (enterprise dashboard + custom metrics + anomaly detection + compliance).
Validation Checklist:
Safety & Auditability:
- No secrets in output: Redact all API keys, tokens, passwords in dashboard/alert configs.
- Retention compliance: Verify logs retained per policy (90 days for NIST SP 800-92, adjust for GDPR right to be forgotten).
- Audit trail: Dashboard changes tracked via Grafana version history; alert rule changes logged to SIEM.
Determinism:
- Stable queries: Use fixed time ranges for baselines (7-day moving average, not "last week" which shifts daily).
- Consistent naming: Use standardized panel titles (Latency (p95), Traffic (req/s), Errors (%), Saturation (CPU/Memory)).
Resources
Official Documentation:
- Google SRE Book: The Four Golden Signals (accessed 2025-10-26)
- Latency: Time to service a request (distinguish success vs failure latency).
- Traffic: Demand on your system (requests/sec, transactions/sec).
- Errors: Rate of failed requests (HTTP 500s, exceptions).
- Saturation: Resource utilization (CPU, memory, disk, network near capacity).
- OpenTelemetry Documentation (accessed 2025-10-26)
- OTLP protocol specification, instrumentation guides, collector configuration.
- Grafana 11 Correlations (accessed 2025-10-26)
- Setup guide for automatic correlations between data sources.
- Prometheus Alerting Best Practices (accessed 2025-10-26)
- Multi-window burn rate alerts, alert routing, notification templates.
- NIST SP 800-92: Guide to Computer Security Log Management (accessed 2025-10-26)
- Log retention requirements, encryption standards, access controls.
Complementary Skills:
observability-slo-calculator: Computes SLO compliance, error budgets, burn rates (invoke for T2/T3).
observability-stack-configurator: Deploys Prometheus, Loki, Tempo, Grafana stack (invoke for T3).
OpenTelemetry Collector Reference Config:
Grafana Dashboard Examples:
SLO/Error Budget Methodology:
Security & Compliance:
1---2name: observability-unified-dashboard3description: Design unified dashboards with golden signals, OpenTelemetry correlation, SLO tracking, and Grafana 11 auto-correlations for metrics/logs/traces.4license: Apache-2.05---67## Purpose & When-To-Use89**Purpose:** Design comprehensive observability dashboards that unify metrics, logs, and traces using the Four Golden Signals framework (Latency, Traffic, Errors, Saturation), automate correlations across telemetry signals via OpenTelemetry, track SLO compliance, and configure Grafana 11 with automatic drill-down from alerts to root cause.1011**When to Use:**12- You need a **single pane of glass** for monitoring distributed systems (microservices, cloud-native apps).13- You want to implement **SRE best practices** (Golden Signals, SLO tracking, error budget management).14- You have **multiple telemetry sources** (Prometheus, Loki, Tempo, Jaeger, CloudWatch, Datadog) and need unified visibility.15- You need **automatic correlation** from high-level metrics (latency spike) → detailed logs (error messages) → distributed traces (slow span).16- You're migrating from **tool-specific dashboards** (separate Prometheus/Grafana, ELK, Jaeger UIs) to a unified platform.17- You require **real-time SLO compliance** tracking with burn rate alerts.1819**Orchestrates:**20- `observability-slo-calculator`: Computes SLO compliance, error budgets, and burn rates.21- `observability-stack-configurator`: Deploys Prometheus, Loki, Tempo, Grafana stack.2223**Complements:**24- `database-postgres-architect`, `database-mongodb-architect`, `database-redis-architect`: Adds database-specific metrics (query latency, cache hit rate).25- `cloud-kubernetes-architect`: Integrates k8s metrics (pod restarts, resource saturation).2627## Pre-Checks2829**Mandatory Inputs:**30- `services`: List of services/systems to monitor (≥1). Each service should have a unique `service.name` (OpenTelemetry resource attribute).31- `telemetry_sources`: At least one data source for metrics (e.g., Prometheus), logs (e.g., Loki), or traces (e.g., Tempo).32- `deployment_env`: Environment context to filter data (production, staging, dev).3334**Validation Steps:**351. **Compute NOW_ET** using NIST time.gov semantics (America/New_York, ISO-8601) for timestamp anchoring.362. **Check telemetry_sources accessibility:** Verify endpoints are reachable (HTTP 200 for Prometheus `/api/v1/status/config`, Loki `/ready`, Tempo `/ready`).373. **Verify OpenTelemetry instrumentation:** Confirm services emit OTLP (OpenTelemetry Protocol) data with `trace_id` and `span_id` propagation.384. **Validate SLO targets format:** If provided, ensure SLOs follow `<SLI> <comparator> <target>` format (e.g., `availability >= 99.9%`, `p95_latency < 200ms`).395. **Abort if:**40 - Zero telemetry sources configured.41 - Services list is empty or lacks `service.name` attributes.42 - Data sources return 401 (authentication failure) or 404 (endpoint not found).4344## Procedure4546### T1: Quick Dashboard Setup (≤2k tokens, 80% use case)4748**Goal:** Generate a minimal unified dashboard with the Four Golden Signals for a single service using existing Prometheus/Loki/Tempo data sources.4950**Steps:**511. **Identify primary service:** Select the most critical service from `services` list (or use first entry if priority not specified).522. **Query telemetry sources for baseline metrics:**53 - **Latency:** `histogram_quantile(0.95, rate(http_request_duration_seconds_bucket{job="<service>"}[5m]))`54 - **Traffic:** `sum(rate(http_requests_total{job="<service>"}[5m]))`55 - **Errors:** `sum(rate(http_requests_total{job="<service>", status=~"5.."}[5m])) / sum(rate(http_requests_total{job="<service>"}[5m])) * 100`56 - **Saturation:** `avg(process_cpu_seconds_total{job="<service>"})` and `avg(process_resident_memory_bytes{job="<service>"})`573. **Generate Grafana dashboard JSON:**58 - 4 panels (one per golden signal), arranged in a 2×2 grid.59 - Time range: Last 1 hour (default).60 - Refresh interval: 30 seconds.614. **Add basic alert rule:**62 - Alert if error rate > 5% for 5 minutes (severity: warning).635. **Output:** Dashboard JSON + alert rule YAML (Grafana-managed alerting format).6465**Token Budget:** ≤2k tokens (no deep SLO calculation, no complex correlation setup).6667### T2: Unified Dashboard with SLO Tracking (≤6k tokens)6869**Goal:** Create a comprehensive dashboard with Golden Signals, SLO compliance tracking, automated correlations, and multi-service support.7071**Steps:**721. **Invoke `observability-slo-calculator` (T2):**73 - Pass `slo_targets`, `services`, and `telemetry_sources` (Prometheus for metrics, Loki for logs).74 - Retrieve: SLO compliance %, error budget remaining, burn rate, time to exhaustion.752. **Design multi-service dashboard:**76 - **Overview panel:** Table showing all services with current SLO status (✅ compliant, ⚠️ warning, ❌ breached).77 - **Per-service rows:** Each service gets 4 golden signal panels + 1 SLO panel.78 - **Heatmap panel:** Latency distribution across all services (percentiles: p50, p95, p99).793. **Configure OpenTelemetry correlations:**80 - **Metrics → Logs:** Add correlation from Prometheus alert → Loki logs filtered by `service.name` and `trace_id`.81 - **Logs → Traces:** Add correlation from Loki log entry → Tempo trace lookup via `trace_id`.82 - **Configuration:** Use Grafana 11 Correlations API (`POST /api/datasources/uid/<uid>/correlations`).834. **Set up automated alert routing:**84 - **Critical alerts** (SLO burn rate > 14.4x, error rate > 10%): Route to PagerDuty.85 - **Warning alerts** (SLO burn rate > 6x, error rate > 5%): Route to Slack.86 - **Info alerts** (SLO trending toward breach in 7 days): Route to email.875. **Generate OpenTelemetry Collector pipeline:**88 ```yaml89 receivers:90 otlp:91 protocols:92 grpc:93 http:94 processors:95 batch:96 timeout: 10s97 send_batch_size: 102498 resource:99 attributes:100 - key: deployment.environment101 value: ${DEPLOYMENT_ENV}102 action: insert103 exporters:104 prometheus:105 endpoint: "prometheus:9090"106 loki:107 endpoint: "http://loki:3100/loki/api/v1/push"108 tempo:109 endpoint: "tempo:4317"110 service:111 pipelines:112 metrics:113 receivers: [otlp]114 processors: [batch, resource]115 exporters: [prometheus]116 logs:117 receivers: [otlp]118 processors: [batch, resource]119 exporters: [loki]120 traces:121 receivers: [otlp]122 processors: [batch, resource]123 exporters: [tempo]124 ```1256. **Validation:**126 - Test correlation: Click Prometheus alert → verify Loki logs appear → click log line → verify Tempo trace opens.127 - Test SLO tracking: Trigger synthetic error (increase 5xx responses) → confirm error budget decreases.1287. **Output:**129 - Dashboard JSON (multi-service, golden signals, SLO panels).130 - Correlation rules JSON (3 rules: metrics→logs, logs→traces, traces→metrics).131 - Alert rules YAML (5-10 rules based on golden signals + SLO burn rate).132 - OpenTelemetry Collector config YAML.133 - SLO summary report (current compliance, burn rate, time to exhaustion).134135**Token Budget:** ≤6k tokens (includes SLO calculation delegation, correlation setup, multi-service config).136137### T3: Enterprise-Scale Dashboard with Advanced Features (≤12k tokens)138139**Goal:** Deploy a production-grade unified observability platform with custom metrics, anomaly detection, capacity planning, and compliance reporting.140141**Steps:**1421. **Invoke `observability-stack-configurator` (T3):**143 - Deploy full stack (Prometheus, Loki, Tempo, Grafana 11) with HA (high availability).144 - Configure persistent storage (retention: metrics 30 days, logs 90 days, traces 7 days).1452. **Extend dashboard with custom metrics:**146 - **Business metrics:** Order conversion rate, payment success rate, user signups/hour.147 - **Infrastructure metrics:** Database query latency (PostgreSQL, MongoDB, Redis), cache hit rate, queue depth (Kafka, RabbitMQ).148 - **Security metrics:** Failed login attempts, API rate limit hits, TLS certificate expiry countdown.1493. **Implement anomaly detection:**150 - Use Prometheus recording rules to compute baseline metrics (7-day moving average for latency, traffic).151 - Alert on deviations: `abs(current_latency - baseline_latency) / baseline_latency > 0.3` (30% deviation).1524. **Capacity planning panel:**153 - Extrapolate resource usage (CPU, memory, disk) to predict when thresholds will be hit.154 - Example: If disk usage grows at 2GB/day and 80GB free, alert "Disk full in 40 days."1555. **Compliance reporting:**156 - **NIST SP 800-92 Log Management:** Verify logs retained for required period (90 days), encrypted at rest.157 - **GDPR/CCPA:** Ensure PII redaction in logs (email, IP addresses masked).158 - Generate monthly compliance report: log retention status, encryption enabled, access audit trail.1596. **Advanced correlations:**160 - **Traces → Metrics:** From slow trace span → view aggregated latency metrics for that endpoint.161 - **Logs → Metrics:** From error log → view error rate time series.162 - **Cross-service correlation:** Link frontend error → backend API trace → database slow query log.1637. **Multi-environment dashboard:**164 - Separate panels for production, staging, dev environments.165 - Environment selector variable (Grafana template variable) to toggle between envs.1668. **Generate comprehensive documentation:**167 - Runbook for common alerts (High error rate → check recent deployments, review logs, rollback if needed).168 - Troubleshooting guide (Correlation not working → verify `trace_id` propagation, check OTLP endpoints).1699. **Validation:**170 - Simulate production incident: Inject latency spike → verify anomaly detection alerts → follow correlation chain → confirm root cause identified.171 - Audit compliance: Run GDPR compliance check → verify PII redacted, logs encrypted.17210. **Output:**173 - Multi-environment dashboard JSON (production, staging, dev).174 - 20+ alert rules (golden signals + SLO + anomaly detection + capacity planning).175 - OpenTelemetry Collector config with advanced processors (attributes, tail sampling, span metrics).176 - Compliance report (log retention, encryption status, PII redaction confirmation).177 - Runbook documentation (5-10 common scenarios with resolution steps).178179**Token Budget:** ≤12k tokens (includes stack deployment, advanced analytics, compliance checks, documentation).180181## Decision Rules182183**Ambiguity Resolution:**1841. **If `slo_targets` not provided:**185 - Use **industry-standard defaults**: 99.9% availability (3 nines), p95 latency < 500ms, error rate < 1%.186 - Emit warning: "No SLO targets specified; using defaults. Review and adjust based on business requirements."1872. **If telemetry source lacks one signal type (e.g., no traces):**188 - Proceed with available signals (metrics + logs only).189 - Emit note: "Tempo not configured; trace correlation unavailable. Install Tempo for full observability."1903. **If multiple services with same `service.name`:**191 - Abort and request clarification: "Duplicate service names detected. Ensure unique `service.name` attributes per service."1924. **If alert destinations not specified:**193 - Default to **Grafana built-in alerting** (notifications visible in Grafana UI only).194 - Suggest: "Configure PagerDuty, Slack, or email for external alert routing."195196**Stop Conditions:**197- **Insufficient data:** Telemetry sources return zero metrics/logs/traces for >5 minutes → abort with error: "No data from telemetry sources. Verify instrumentation and OTLP exporters."198- **Authentication failure:** All data sources return 401/403 → abort with error: "Authentication failed for telemetry sources. Check credentials and API tokens."199- **Incompatible versions:** Grafana version < 10.0 detected → warn: "Correlations require Grafana 11+. Upgrade recommended."200201**Thresholds:**202- **Golden Signal Alerts:**203 - Latency: p95 > 2× baseline for 5 minutes.204 - Traffic: >50% drop from baseline for 5 minutes (potential outage).205 - Errors: >5% error rate for 5 minutes.206 - Saturation: CPU >80%, memory >85%, disk >90% for 5 minutes.207- **SLO Burn Rate Alerts (Google SRE methodology):**208 - **Critical:** 14.4× burn rate (error budget exhausted in 2 days) → page immediately.209 - **Warning:** 6× burn rate (error budget exhausted in 5 days) → notify team.210211## Output Contract212213**Required Fields:**214215```typescript216{217 dashboard_config: {218 uid: string; // Grafana dashboard UID (unique identifier)219 title: string; // Dashboard title (e.g., "Unified Observability: Production Services")220 panels: Array<{ // Array of dashboard panels221 id: number; // Panel ID (unique within dashboard)222 title: string; // Panel title (e.g., "Latency (p95)")223 type: string; // Panel type (graph, stat, table, heatmap)224 targets: Array<{ // Data source queries225 datasource: string; // Data source UID (Prometheus, Loki, Tempo)226 expr: string; // Query expression (PromQL, LogQL, TraceQL)227 }>;228 alert?: { // Optional alert configuration229 name: string; // Alert rule name230 condition: string; // Alert condition (PromQL expression)231 for: string; // Duration threshold (e.g., "5m")232 annotations: {233 summary: string; // Alert summary (e.g., "High error rate detected")234 };235 };236 }>;237 templating: { // Dashboard variables (environment, service selector)238 list: Array<{239 name: string; // Variable name (e.g., "environment")240 type: string; // Variable type (query, custom, interval)241 query: string; // Query to populate variable options242 }>;243 };244 };245 correlation_rules: Array<{ // Grafana correlations246 source_datasource: string; // Source data source UID (e.g., Prometheus)247 target_datasource: string; // Target data source UID (e.g., Loki)248 label: string; // Correlation link label (e.g., "View Logs")249 field: string; // Field to use for correlation (e.g., "trace_id")250 transformation: string; // Optional transformation (e.g., regex extraction)251 }>;252 alert_rules: Array<{ // Alert definitions253 name: string; // Alert rule name254 expr: string; // PromQL expression for alert condition255 for: string; // Duration threshold (e.g., "5m")256 severity: "critical" | "warning" | "info";257 annotations: {258 summary: string; // Human-readable alert summary259 runbook_url?: string; // Link to runbook for resolution steps260 };261 route?: { // Alert routing (optional)262 receiver: string; // Receiver name (PagerDuty, Slack, email)263 };264 }>;265 otel_pipeline: { // OpenTelemetry Collector configuration266 receivers: object; // OTLP receivers (grpc, http)267 processors: object; // Batch, resource, attributes processors268 exporters: object; // Prometheus, Loki, Tempo exporters269 service: {270 pipelines: {271 metrics: { receivers: string[]; processors: string[]; exporters: string[] };272 logs: { receivers: string[]; processors: string[]; exporters: string[] };273 traces: { receivers: string[]; processors: string[]; exporters: string[] };274 };275 };276 };277 slo_summary: { // SLO compliance report (from observability-slo-calculator)278 services: Array<{279 name: string; // Service name280 slo_compliance: number; // Current SLO compliance (0-100%)281 error_budget_remaining: number; // Error budget remaining (%)282 burn_rate: number; // Current error budget burn rate (multiplier)283 time_to_exhaustion_hours: number | null; // Hours until error budget exhausted (null if budget positive)284 status: "compliant" | "warning" | "breached";285 }>;286 overall_compliance: number; // Average compliance across all services287 };288}289```290291**Optional Fields:**292- `custom_panels`: Array of custom dashboard panels for business-specific metrics.293- `capacity_forecast`: Object with resource usage predictions (disk full in X days, etc.).294- `compliance_report`: Object with NIST SP 800-92, GDPR/CCPA compliance status.295- `runbook_links`: Object mapping alert names to runbook URLs.296297**Format:** JSON for `dashboard_config`, `correlation_rules`, `otel_pipeline`, `slo_summary`. YAML for `alert_rules` (Grafana-managed alerting format).298299## Examples300301### Example 1: E-commerce Platform Unified Dashboard (T2)302303**Input:**304```yaml305services:306 - name: "frontend-web"307 type: "web"308 - name: "api-gateway"309 type: "api"310 - name: "order-service"311 type: "backend"312deployment_env: "production"313slo_targets:314 - service: "api-gateway"315 availability: 99.95%316 p95_latency_ms: 200317 - service: "order-service"318 availability: 99.9%319 p95_latency_ms: 500320telemetry_sources:321 metrics: "prometheus-prod"322 logs: "loki-prod"323 traces: "tempo-prod"324alert_destinations:325 - type: "pagerduty"326 integration_key: "REDACTED"327 - type: "slack"328 webhook_url: "REDACTED"329```330331**Output (T2 Summary):**332```yaml333Dashboard: "Unified Observability: E-commerce Production"334 - Overview Panel: 3 services, 2/3 SLO compliant (order-service at 99.85%, warning)335 - Golden Signals (per service):336 api-gateway: Latency p95=150ms ✅, Traffic=1200 req/s, Errors=0.5% ✅, CPU=45%337 order-service: Latency p95=480ms ✅, Traffic=300 req/s, Errors=2.1% ⚠️, CPU=78%338 - Correlations: 3 rules (Prometheus alert → Loki logs → Tempo traces)339 - Alerts:340 - CRITICAL: order-service error rate >5% for 5m → PagerDuty341 - WARNING: order-service SLO burn rate 7.2× (budget exhausted in 4 days) → Slack342OpenTelemetry Pipeline: OTLP receivers → batch processor → Prometheus/Loki/Tempo exporters343SLO Summary:344 - api-gateway: 99.98% compliant (6% error budget remaining, burn rate 0.8×)345 - order-service: 99.85% compliant (85% error budget consumed, burn rate 7.2× ⚠️)346 - Overall: 99.92% compliance347```348349**Link to Full Example:** See `skills/observability-unified-dashboard/examples/ecommerce-unified-dashboard.txt`350351### Example 2: Microservices Platform with Custom Metrics (T3 Snippet)352353**Custom Metrics Added:**354- **Payment success rate:** `sum(rate(payment_transactions_total{status="success"}[5m])) / sum(rate(payment_transactions_total[5m])) * 100`355- **Database query latency:** `histogram_quantile(0.95, rate(db_query_duration_seconds_bucket{db="orders"}[5m]))`356- **Cache hit rate:** `sum(rate(redis_hits_total[5m])) / (sum(rate(redis_hits_total[5m])) + sum(rate(redis_misses_total[5m]))) * 100`357358**Anomaly Detection Alert:**359```yaml360- alert: LatencyAnomalyDetected361 expr: |362 abs(363 histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))364 -365 histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[7d] offset 7d))366 ) / histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[7d] offset 7d)) > 0.3367 for: 10m368 severity: warning369 annotations:370 summary: "Latency 30% higher than 7-day baseline"371 runbook_url: "https://runbooks.example.com/latency-anomaly"372```373374## Quality Gates375376**Token Budget Compliance:**377- T1 output ≤2k tokens (basic dashboard + 1 service).378- T2 output ≤6k tokens (multi-service dashboard + SLO tracking + correlations).379- T3 output ≤12k tokens (enterprise dashboard + custom metrics + anomaly detection + compliance).380381**Validation Checklist:**382- [ ] Dashboard has 4 golden signal panels per service (Latency, Traffic, Errors, Saturation).383- [ ] SLO compliance panel shows current %, error budget remaining, burn rate.384- [ ] Correlations tested: Click metric alert → logs appear → trace opens.385- [ ] Alert rules use multi-window burn rate (1h + 5m for critical, 6h + 30m for warning).386- [ ] OpenTelemetry pipeline config validates against OTEL Collector schema.387- [ ] PII redaction confirmed in logs (regex check for email, SSN, credit card patterns).388- [ ] Dashboard JSON imports successfully into Grafana 11+ without errors.389390**Safety & Auditability:**391- **No secrets in output:** Redact all API keys, tokens, passwords in dashboard/alert configs.392- **Retention compliance:** Verify logs retained per policy (90 days for NIST SP 800-92, adjust for GDPR right to be forgotten).393- **Audit trail:** Dashboard changes tracked via Grafana version history; alert rule changes logged to SIEM.394395**Determinism:**396- **Stable queries:** Use fixed time ranges for baselines (7-day moving average, not "last week" which shifts daily).397- **Consistent naming:** Use standardized panel titles (Latency (p95), Traffic (req/s), Errors (%), Saturation (CPU/Memory)).398399## Resources400401**Official Documentation:**402- [Google SRE Book: The Four Golden Signals](https://sre.google/sre-book/monitoring-distributed-systems/) (accessed 2025-10-26)403 - Latency: Time to service a request (distinguish success vs failure latency).404 - Traffic: Demand on your system (requests/sec, transactions/sec).405 - Errors: Rate of failed requests (HTTP 500s, exceptions).406 - Saturation: Resource utilization (CPU, memory, disk, network near capacity).407- [OpenTelemetry Documentation](https://opentelemetry.io/docs/) (accessed 2025-10-26)408 - OTLP protocol specification, instrumentation guides, collector configuration.409- [Grafana 11 Correlations](https://grafana.com/docs/grafana/latest/administration/correlations/) (accessed 2025-10-26)410 - Setup guide for automatic correlations between data sources.411- [Prometheus Alerting Best Practices](https://prometheus.io/docs/practices/alerting/) (accessed 2025-10-26)412 - Multi-window burn rate alerts, alert routing, notification templates.413- [NIST SP 800-92: Guide to Computer Security Log Management](https://csrc.nist.gov/publications/detail/sp/800-92/final) (accessed 2025-10-26)414 - Log retention requirements, encryption standards, access controls.415416**Complementary Skills:**417- `observability-slo-calculator`: Computes SLO compliance, error budgets, burn rates (invoke for T2/T3).418- `observability-stack-configurator`: Deploys Prometheus, Loki, Tempo, Grafana stack (invoke for T3).419420**OpenTelemetry Collector Reference Config:**421- [OTEL Collector Configuration](https://opentelemetry.io/docs/collector/configuration/)422- [Prometheus Exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/prometheusexporter)423- [Loki Exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/lokiexporter)424- [Tempo Exporter (OTLP)](https://grafana.com/docs/tempo/latest/configuration/otlp/)425426**Grafana Dashboard Examples:**427- [Grafana Labs: SLO Dashboard](https://grafana.com/grafana/dashboards/14683-slo-dashboard/)428- [Grafana Labs: OpenTelemetry APM](https://grafana.com/grafana/dashboards/19419-opentelemetry-apm/)429430**SLO/Error Budget Methodology:**431- [Google SRE Workbook: Implementing SLOs](https://sre.google/workbook/implementing-slos/)432- [Sloth: Easy SLO definition and alerting (SLO generator)](https://github.com/slok/sloth)433434**Security & Compliance:**435- [OWASP Logging Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html) (PII redaction guidance)436- [GDPR Article 17: Right to Erasure](https://gdpr-info.eu/art-17-gdpr/) (log retention implications)