Okay, the user is asking for a golden signal SRE layer, which means they want a structured framework covering the four key metrics (latency, traffic, errors, saturation) plus alerts. This is a standard SRE concept, but I need to make it practical and actionable, not just theoretical.
First, I should define each signal clearly with concrete examples relevant to different system layers (infrastructure, application, business). The user might be an SRE or DevOps engineer looking to implement monitoring, so practicality is key. I'll avoid vague definitions and focus on how to measure each signal.
Alerts need their own section because they're the actionable output. I should emphasize that alerts must be tied to user impact, not just raw metrics. The user probably wants to reduce noise and focus on what matters. I'll include alert design principles and examples to make it useful.
I should also mention tooling briefly since implementation matters. But the core is the framework itself, so I'll keep tooling as a footnote unless the user asks for more. The response should flow logically: define signals, then alerts, then a summary table for quick reference.
Make sure to connect each signal to SLOs where relevant, since that's how SREs operationalize these signals. The user might not have said it, but they likely want to tie this to reliability goals. I'll weave that in without overcomplicating.
Finally, structure it with clear headings and a table for the summary. The user probably wants to share this with a team or use it as a checklist, so clarity and scannability are important. Avoid jargon without explanation, but assume they know SRE basics since they used the term "golden signals."
Excellent. Creating a "golden signals" SRE layer is the foundational practice for observability and reliability. It moves monitoring from "is something broken?" to "how is our service performing for users?"
Here is a comprehensive, actionable framework for the Golden Signals SRE Layer, designed to be implemented across your technology stack.
The Core Philosophy: User-Centric Observability
Golden signals are measured from the perspective of the user or client, not the server. They answer: "What is the user's experience right now?"
1. The Four Golden Signals
A. Latency
Definition: The time it takes to service a request. Crucially, this should be measured as a distribution (e.g., p50, p90, p99), not just an average.
What to Measure:
Request Latency: Time from request dispatch to last byte of response (for APIs: upstream_response_time or equivalent).
End-to-End User Latency: Full browser/page load time (measured via Real User Monitoring - RUM).
Database Query Latency: Time for a single DB operation.
Dependency Latency: Time spent calling external services (3rd party APIs, other internal services).
SRE Action: Track latency percentiles (p50, p90, p99) against Latency SLOs. A rising p99 is often the earliest sign of degradation.
B. Traffic
Definition: A measure of demand on your service. This is the "load" dimension.
What to Measure:
Request Rate: Requests per second (RPS) or minute (RPM) to your service.
Concurrent Users/Connections: Active sessions or connections.
Data Throughput: Gigabits/second or MB/second of network I/O or disk I/O.
Business Metrics: Transactions per second, orders per minute, active users. (This connects technical health to business health).
SRE Action: Correlate traffic spikes with latency and errors. Is your service degrading under load? This defines your capacity.
C. Errors
Definition: The rate of requests that fail. Must be defined from the user's perspective.
What to Measure:
HTTP 5xx Server Errors: The classic "server is broken" signal.
HTTP 4xx Client Errors: Can indicate client bugs or malicious traffic (rate limit them). Do not ignore 4xxes—a sudden spike in 404 might mean a broken deployment or attack.
SLO Error Budget Burn: Track errors against your SLO (e.g., "good requests" / total requests).
SRE Action:This is the primary alerting signal. An elevated error rate is a direct customer impact. Classify errors (e.g., 500.503 vs 500.504) for prioritization.
D. Saturation
Definition: How "full" your service is. It measures resource utilization that prevents the system from handling additional load. It's about approaching a hard limit.
What to Measure (Key Resources):
CPU: Utilization, run queue length (load average), steal time (in VMs).
Memory: Utilization, swap usage (a red flag), OOM kills.
Disk: I/O utilization (await, %util), disk space % used, inode exhaustion.
SRE Action: Saturation is a leading indicator of imminent failure. Alert on approaching limits (e.g., >85% CPU for 5m), not just after a crash.
2. The Alerting Layer (The Fifth Element)
Alerts are how the golden signals become actionable. Bad alerts create fatigue; good alerts drive the right action.
Alert Design Principles:
Signal User Impact: An alert should mean "users are being affected or will be imminently."
Signal Specificity: The alert message must state: What is failing? Where? How severe? What's the user impact? Include a direct link to the dashboard/graph.
Signal Urgency: Tier alerts (P0/P1/P2). Base it on Error Rate & SLO Burn.
Critical (P0):Error Rate > X% for Y minutes (SLO violation) orLatency p99 > Z for Y minutesand traffic is non-zero.
Info (P2):Traffic trend > 150% of baseline for 1h (capacity planning).
Avoid Thresholds on Baselines: Don't alert on "CPU > 90%." Alert on "CPU > 90% and latency is rising" or "CPU > 90% and we are within 10% of our traffic capacity model."
Example Alert Rules (Prometheus-style Notation):
yaml
# CRITICAL: User-Impact Error
- alert: ServiceHighErrorRate
expr: sum(rate(http_requests_total{status=~"5.."}[5m])) by (service) / sum(rate(http_requests_total[5m])) by (service) > 0.05
for: 2m
labels:
severity: critical
annotations:
summary: "High error rate on {{ $labels.service }}"
description: "{{ $labels.service }} has an error rate of {{ $value | humanizePercentage }} for the last 2 minutes. Users are experiencing failures."
# CRITICAL: SLO Violation (Latency)
- alert: ServiceLatencySLOViolation
expr: histogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket[5m])) by (le, service)) > 0.5
for: 5m
labels:
severity: critical
annotations:
summary: "p99 latency SLO violation on {{ $labels.service }}"
description: "p99 latency is {{ $value | humanizeDuration }}, above the 500ms SLO."
# WARNING: Saturation (Leading Indicator)
- alert: ServiceHighCPUWait
expr: rate(node_cpu_seconds_total{mode="iowait"}[5m]) * 100 > 20
for: 10m
labels:
severity: warning
annotations:
summary: "High I/O wait on {{ $labels.instance }}"
description: "The instance is spending >20% of its CPU time waiting on I/O, a leading indicator of disk saturation."
3. Implementation & Tooling Layer
Metrics Collection: Prometheus, OpenTelemetry, Datadog Agent, New Relic.
Tied to user impact & SLOs. Message includes: What, Where, Impact, Link.
** Defined by SLOs & impact
Final Checklist for Implementation:
Instrument every service and tier (infra, app, db) to emit these four signal types.
Build a standard, templated dashboard for every service using these four signals.
Define SLOs for Latency and Error Rate for every user-facing service.
Create alert rules based on SLO violation and saturation leading indicators. Burn rate alerts on error budget are best.
Review and tune alerts weekly. Are they firing correctly? Are they actionable? Are they noisy?
Runbooks: Every critical alert must link to a runbook that answers: "What is the first command/check to diagnose this?"
This framework transforms your monitoring from a passive log viewer into an active reliability control plane. The goal is not to have zero alerts, but to have only the right alerts—ones that tell you when users are being harmed, so you can act with urgency and precision.