Dashboards don’t tell you when to wake someone up. An open source observability stack earns its keep when a metric, a trace and a log line all point at the same failed request. The alert should fire because users are losing the error budget, not because a CPU graph looked scary. This guide builds that whole loop on one VM with Docker Compose: an OpenTelemetry app, Grafana Alloy, Prometheus, Loki, Tempo, Grafana, Alertmanager and Pyrra for the SLOs.
We tested it on Ubuntu 26.04 in November 2026 with Prometheus 3.16, Grafana 13.3, Loki 3.7, Tempo 3.1, Alloy 1.21 and Pyrra 0.10, then broke the app on purpose. You’ll see the real fast-burn page, the error budget going negative and the trace of one failed checkout. Component installs have their own guides, so this one covers the parts that connect them.
Understand what the stack does
Every signal leaves the app once, over OTLP, and lands in Alloy. Alloy batches it and splits it three ways: metrics go to Prometheus by remote write with exemplars attached, logs go to the Loki OTLP endpoint and traces go to Tempo. Grafana reads all three, and the links between them are what make the stack worth running instead of three separate tools.

Pyrra sits beside Prometheus rather than in the data path. It reads SLO definitions from YAML files, writes recording and alerting rules into a shared volume, and Prometheus loads them like any other rule file. Alertmanager then routes the burn-rate alerts by severity: critical pages, warnings open tickets. Mimir is an optional swap for Prometheus once you need long retention or several tenants; this lab keeps plain Prometheus so the moving parts stay visible.
Pick SLIs before you pick dashboards
An SLI is a ratio of good events to all events, measured where users feel it. For a checkout API that means two questions: did the request succeed, and was it fast enough? We do not measure CPU, queue depth or pod restarts here, because users never see those directly. They belong on debugging dashboards, not in an SLO.
The app below is instrumented with the stable OpenTelemetry HTTP semantic conventions, so its histogram is http_server_request_duration_seconds with the label http_response_status_code. Availability is the share of requests that didn’t return a 5xx:
sum(rate(http_server_request_duration_seconds_count{job="checkout",http_response_status_code!~"5.."}[5m]))
/
sum(rate(http_server_request_duration_seconds_count{job="checkout"}[5m]))
Latency is the share of requests that finished inside a bucket boundary. Pick a boundary that already exists in the histogram, because a le value with no bucket behind it matches no series and the query returns no data. The default OpenTelemetry buckets include 0.25 seconds, so we used that.
sum(rate(http_server_request_duration_seconds_bucket{job="checkout",le="0.25"}[5m]))
/
sum(rate(http_server_request_duration_seconds_count{job="checkout"}[5m]))
Both queries return 1 on a healthy service and drop toward 0 as things break. You will lean on that shape later: Pyrra builds every burn-rate rule from exactly these two ratios. If rate() and histogram_quantile() still feel shaky, the PromQL cheat sheet covers them with worked examples.
Run the stack with Docker Compose
Our lab VM had 4 vCPUs and 16 GB of RAM, and the whole stack idled at about 1 GB used. Treat that as the floor you start from for one service at roughly 30 requests a second. In production, active series count and retention drive Prometheus memory, log volume per day drives the Loki disk, and the trace sampling rate drives Tempo. Run the stack for a week, read prometheus_tsdb_head_series and the volume sizes, and size from those numbers rather than from this lab.
You need Docker Engine with the Compose plugin, plus jq for one query later (sudo apt install -y jq). Check that you have Docker and Compose on your host.
docker version --format '{{.Server.Version}}'
docker compose version
Our lab VM reported these versions.
29.9.3
Docker Compose version v5.7.1
Create a project directory with folders for the app, the Pyrra SLO files and Grafana provisioning.
mkdir -p ~/obs/app ~/obs/pyrra ~/obs/grafana/provisioning/datasources
cd ~/obs
The Grafana admin password comes from a .env file that Compose reads on its own. Generate a random one and keep the file private.
echo "GRAFANA_ADMIN_PASSWORD=$(openssl rand -base64 18)" > .env
chmod 600 .env
Now the Compose file. Every port binds to 127.0.0.1, so nothing is reachable from the network until you decide how to expose it. Four loadgen replicas hit the checkout endpoint every 100 ms, which gives the SLOs enough traffic to mean something:
vim compose.yaml
Paste the exact file the lab ran.
name: obs
services:
app:
build: ./app
environment:
OTEL_SERVICE_NAME: checkout
OTEL_RESOURCE_ATTRIBUTES: deployment.environment=lab
OTEL_EXPORTER_OTLP_ENDPOINT: http://alloy:4318
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
OTEL_METRIC_EXPORT_INTERVAL: "10000"
OTEL_SEMCONV_STABILITY_OPT_IN: http
OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED: "true"
ports:
- "127.0.0.1:8080:8080"
depends_on:
- alloy
loadgen:
image: curlimages/curl:8.17.0
command: ["sh", "-c", "while true; do curl -s -o /dev/null http://app:8080/api/checkout; sleep 0.1; done"]
deploy:
replicas: 4
depends_on:
- app
alloy:
image: grafana/alloy:v1.21.3
command: ["run", "/etc/alloy/config.alloy", "--server.http.listen-addr=0.0.0.0:12345", "--storage.path=/var/lib/alloy/data"]
volumes:
- ./config.alloy:/etc/alloy/config.alloy:ro
ports:
- "127.0.0.1:12345:12345"
prometheus:
image: prom/prometheus:v3.16.0
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.retention.time=33d
- --web.enable-remote-write-receiver
- --web.enable-lifecycle
- --enable-feature=exemplar-storage
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
- pyrra-rules:/etc/prometheus/pyrra
ports:
- "127.0.0.1:9090:9090"
alertmanager:
image: prom/alertmanager:v0.35.0
volumes:
- ./alertmanager.yml:/etc/alertmanager/alertmanager.yml:ro
ports:
- "127.0.0.1:9093:9093"
alert-sink:
build: ./app
command: ["python", "webhook.py"]
loki:
image: grafana/loki:3.7.9
command: ["-config.file=/etc/loki/loki.yaml"]
volumes:
- ./loki.yaml:/etc/loki/loki.yaml:ro
- loki-data:/loki
tempo:
image: grafana/tempo:3.1.1
command: ["-target=all", "-config.file=/etc/tempo.yaml"]
volumes:
- ./tempo.yaml:/etc/tempo.yaml:ro
- tempo-data:/var/tempo
pyrra-filesystem:
image: ghcr.io/pyrra-dev/pyrra:v0.10.2
user: root
command: ["filesystem", "--prometheus-url=http://prometheus:9090"]
volumes:
- ./pyrra:/etc/pyrra:ro
- pyrra-rules:/etc/prometheus/pyrra
pyrra-api:
image: ghcr.io/pyrra-dev/pyrra:v0.10.2
command: ["api", "--prometheus-url=http://prometheus:9090", "--prometheus-external-url=http://localhost:9090", "--api-url=http://pyrra-filesystem:9444"]
ports:
- "127.0.0.1:9099:9099"
grafana:
image: grafana/grafana:13.3.1
environment:
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD}
volumes:
- ./grafana/provisioning:/etc/grafana/provisioning:ro
- grafana-data:/var/lib/grafana
ports:
- "127.0.0.1:3000:3000"
volumes:
prometheus-data:
pyrra-rules:
loki-data:
tempo-data:
grafana-data:
Three flags on Prometheus do real work. --web.enable-remote-write-receiver lets Alloy push metrics in, --enable-feature=exemplar-storage keeps the trace IDs that ride along with them, and the 33 day retention covers the 28 day SLO window with a few days to spare. Drop any of them and you lose a later section without any error to tell you why. The pyrra-rules volume is shared between Pyrra, which writes rules into it, and Prometheus, which reads them.
Prometheus scrapes itself and Alloy, evaluates whatever rules Pyrra writes, and sends alerts to Alertmanager:
vim prometheus.yml
Add the scrape, rule and alerting settings.
global:
scrape_interval: 15s
evaluation_interval: 15s
rule_files:
- /etc/prometheus/pyrra/*.yaml
alerting:
alertmanagers:
- static_configs:
- targets: ["alertmanager:9093"]
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ["localhost:9090"]
- job_name: alloy
static_configs:
- targets: ["alloy:12345"]
Loki and Tempo both run as single binaries on local disk. That is fine for a lab and for small teams, but neither config survives losing the volume. The Loki install guide and the Tempo install guide cover object storage backends for when you outgrow this. Save the Loki config as loki.yaml.
auth_enabled: false
server:
http_listen_port: 3100
common:
instance_addr: 127.0.0.1
path_prefix: /loki
storage:
filesystem:
chunks_directory: /loki/chunks
rules_directory: /loki/rules
replication_factor: 1
ring:
kvstore:
store: inmemory
schema_config:
configs:
- from: 2024-01-01
store: tsdb
object_store: filesystem
schema: v13
index:
prefix: index_
period: 24h
analytics:
reporting_enabled: false
Tempo only needs an OTLP gRPC receiver and a local block path. Save this as tempo.yaml:
stream_over_http_enabled: true
server:
http_listen_port: 3200
distributor:
receivers:
otlp:
protocols:
grpc:
endpoint: "tempo:4317"
storage:
trace:
backend: local
wal:
path: /var/tempo/wal
local:
path: /var/tempo/blocks
usage_report:
reporting_enabled: false
Alertmanager gets two receivers. Anything labelled severity="critical" goes to page and everything else to ticket, grouped per alert name and SLO so one incident produces one notification instead of four:
vim alertmanager.yml
In the lab, both receivers point at a small webhook sink. You swap the URLs for Slack, PagerDuty or email when you go live.
route:
receiver: ticket
group_by: ["alertname", "slo"]
group_wait: 30s
group_interval: 5m
repeat_interval: 4h
routes:
- matchers: ['severity="critical"']
receiver: page
receivers:
- name: page
webhook_configs:
- url: http://alert-sink:9000/page
- name: ticket
webhook_configs:
- url: http://alert-sink:9000/ticket
Our guide to Alertmanager with Slack, email and PagerDuty has the receiver blocks for real channels. Keep the routing tree as it is when you swap them; the severity split is what turns burn rates into the right kind of interruption.
Instrument the app and send it through Alloy
The demo service is a small Flask app with one endpoint, /api/checkout, and an admin switch that injects errors and delays at runtime. We do not touch OpenTelemetry in the code at all. The opentelemetry-instrument wrapper patches Flask and Python logging at startup, which is the zero-code path the OpenTelemetry Python distro supports:
vim app/app.py
The failure path logs an error before it returns the 500, so the log line and the span share a trace ID:
import logging
import random
import time
from flask import Flask, jsonify, request
app = Flask(__name__)
log = logging.getLogger("checkout")
log.setLevel(logging.INFO)
# Runtime fault switch, changed with POST /admin/fault
fault = {"error_rate": 0.0, "delay_rate": 0.0, "delay_ms": 0.0}
@app.get("/api/checkout")
def checkout():
if random.random() < fault["delay_rate"]:
time.sleep(fault["delay_ms"] / 1000)
if random.random() < fault["error_rate"]:
log.error("payment provider timeout, order rejected")
return jsonify(error="payment provider timeout"), 500
log.info("order accepted")
return jsonify(status="ok")
@app.post("/admin/fault")
def set_fault():
for key in fault:
if key in request.args:
fault[key] = float(request.args[key])
log.warning("fault settings changed: %s", fault)
return jsonify(fault)
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8080, threaded=True)
Alongside the app, the same image runs the alert sink, a tiny HTTP server that prints each alert Alertmanager posts. Save it as app/webhook.py:
import json
from http.server import BaseHTTPRequestHandler, HTTPServer
class Hook(BaseHTTPRequestHandler):
def do_POST(self):
body = json.loads(self.rfile.read(int(self.headers["Content-Length"])))
for a in body["alerts"]:
print(self.path, a["status"], a["labels"].get("alertname"),
a["labels"].get("severity"), a["labels"].get("long"),
a["startsAt"], flush=True)
self.send_response(200)
self.end_headers()
HTTPServer(("0.0.0.0", 9000), Hook).serve_forever()
opentelemetry-bootstrap -a install inspects the installed packages and pulls the matching instrumentation libraries, Flask included. Save the build file as app/Dockerfile.
FROM python:3.13-slim
WORKDIR /app
RUN pip install --no-cache-dir flask opentelemetry-distro opentelemetry-exporter-otlp \
&& opentelemetry-bootstrap -a install
COPY app.py webhook.py ./
CMD ["opentelemetry-instrument", "python", "app.py"]
Back in the Compose file, OTEL_SEMCONV_STABILITY_OPT_IN=http is the line people miss. Without it the Python instrumentation keeps the old http.server.duration metric in milliseconds, and every SLI query above returns nothing. Python log records reach Loki over OTLP with the active trace and span IDs attached. The OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED line is deprecated in current opentelemetry-python, which now ships logs through the default logging instrumentation; it still worked in our run, but you can drop it on a new build.
Alloy receives OTLP on 4317 and 4318, batches everything and fans it out. Exemplars travel with remote write by default; send_exemplars = true only makes that explicit, and the jump from graph to trace also needs the Prometheus feature flag and the Grafana setting further down.
vim config.alloy
Paste the pipeline as you see it here.
otelcol.receiver.otlp "default" {
grpc {
endpoint = "0.0.0.0:4317"
}
http {
endpoint = "0.0.0.0:4318"
}
output {
metrics = [otelcol.processor.batch.default.input]
logs = [otelcol.processor.batch.default.input]
traces = [otelcol.processor.batch.default.input]
}
}
otelcol.processor.batch "default" {
output {
metrics = [otelcol.exporter.prometheus.default.input]
logs = [otelcol.exporter.otlphttp.loki.input]
traces = [otelcol.exporter.otlp.tempo.input]
}
}
otelcol.exporter.prometheus "default" {
forward_to = [prometheus.remote_write.local.receiver]
}
prometheus.remote_write "local" {
endpoint {
url = "http://prometheus:9090/api/v1/write"
send_exemplars = true
}
}
otelcol.exporter.otlphttp "loki" {
client {
endpoint = "http://loki:3100/otlp"
}
}
otelcol.exporter.otlp "tempo" {
client {
endpoint = "tempo:4317"
tls {
insecure = true
}
}
}
Running Alloy as a system service instead of a container takes the same config file; the Alloy guide for Ubuntu and Debian and its Rocky Linux and AlmaLinux counterpart cover the packages. To move metrics to Mimir, point the remote_write URL at the Mimir push endpoint and Pyrra at the Mimir Prometheus API. The rule files Pyrra writes then need loading into the Mimir ruler, for example with mimirtool rules sync, or nothing evaluates them. The Mimir install guide has the server side. We didn’t run that swap in this lab, but the OpenTelemetry pipeline through Grafana Alloy to Tempo, Mimir and Loki builds the Alloy to Mimir remote_write path end to end.
Wire the Grafana signal links
Provisioning the data sources from a file means the links between them exist the moment Grafana starts, and nobody clicks through settings pages to rebuild them. Three settings carry the correlation: exemplar trace IDs from Prometheus to Tempo, a trace to logs query from Tempo to Loki, and a derived field from Loki back to Tempo:
vim grafana/provisioning/datasources/datasources.yaml
The doubled $$ escapes the environment variable expansion Grafana applies to provisioning files.
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
uid: prometheus
url: http://prometheus:9090
isDefault: true
jsonData:
exemplarTraceIdDestinations:
- name: trace_id
datasourceUid: tempo
- name: Tempo
type: tempo
uid: tempo
url: http://tempo:3200
jsonData:
tracesToLogsV2:
datasourceUid: loki
spanStartTimeShift: "-5m"
spanEndTimeShift: "5m"
customQuery: true
query: '{service_name="checkout"} | trace_id="$${__trace.traceId}"'
- name: Loki
type: loki
uid: loki
url: http://loki:3100
jsonData:
derivedFields:
- name: trace_id
matcherType: label
matcherRegex: trace_id
datasourceUid: tempo
url: "$${__value.raw}"
urlDisplayLabel: View trace
The Loki OTLP endpoint stores the trace ID as structured metadata named trace_id, not inside the log text. That is why the derived field uses matcherType: label instead of a regex over the line, and why the trace to logs query filters on trace_id= after the stream selector.
Define the SLOs with Pyrra
Each SLO is one small file. Availability gets a 99% target over 28 days, which leaves an error budget of 1% of requests. Save this as pyrra/checkout-availability.yaml:
apiVersion: pyrra.dev/v1alpha1
kind: ServiceLevelObjective
metadata:
name: checkout-availability
namespace: lab
spec:
target: "99"
window: 28d
description: 99% of checkout requests return a non-5xx response.
indicator:
ratio:
errors:
metric: http_server_request_duration_seconds_count{job="checkout",http_response_status_code=~"5.."}
total:
metric: http_server_request_duration_seconds_count{job="checkout"}
Latency is looser on purpose: 95% of requests under 250 ms, so 5% of requests may be slow before the budget is gone. Save it as pyrra/checkout-latency.yaml:
apiVersion: pyrra.dev/v1alpha1
kind: ServiceLevelObjective
metadata:
name: checkout-latency
namespace: lab
spec:
target: "95"
window: 28d
description: 95% of checkout requests finish in under 250ms.
indicator:
latency:
success:
metric: http_server_request_duration_seconds_bucket{job="checkout",le="0.25"}
total:
metric: http_server_request_duration_seconds_count{job="checkout"}
Bring everything up. The --build flag builds the app image the first time:
chmod 644 compose.yaml config.alloy prometheus.yml alertmanager.yml loki.yaml tempo.yaml pyrra/*.yaml grafana/provisioning/datasources/datasources.yaml
docker compose up -d --build
docker compose ps --format "table {{.Service}}\t{{.Image}}\t{{.Status}}"
The chmod is there because of the first thing that broke in our lab, covered under troubleshooting. Every service should report Up when you list them.
SERVICE IMAGE STATUS
alert-sink obs-alert-sink Up 31 minutes
alertmanager prom/alertmanager:v0.35.0 Up 30 minutes
alloy grafana/alloy:v1.21.3 Up 31 minutes
app obs-app Up 31 minutes
grafana grafana/grafana:13.3.1 Up 27 minutes
loadgen curlimages/curl:8.17.0 Up 31 minutes
loadgen curlimages/curl:8.17.0 Up 31 minutes
loadgen curlimages/curl:8.17.0 Up 31 minutes
loadgen curlimages/curl:8.17.0 Up 31 minutes
loki grafana/loki:3.7.9 Up 30 minutes
prometheus prom/prometheus:v3.16.0 Up 30 minutes
pyrra-api ghcr.io/pyrra-dev/pyrra:v0.10.2 Up 31 minutes
pyrra-filesystem ghcr.io/pyrra-dev/pyrra:v0.10.2 Up 31 minutes
tempo grafana/tempo:3.1.1 Up 30 minutes
Since the ports only listen on localhost, reach the UIs from your workstation through an SSH tunnel. Grafana is on 3000, Prometheus on 9090, Alertmanager on 9093 and Pyrra on 9099.
ssh -N -L 3000:127.0.0.1:3000 -L 9090:127.0.0.1:9090 -L 9093:127.0.0.1:9093 -L 9099:127.0.0.1:9099 [email protected]
Log in to Grafana as admin with the password from .env. The Pyrra filesystem component compiles each SLO file into a rule file in the shared volume and then calls the Prometheus reload endpoint, which is why the Compose file sets --web.enable-lifecycle. You never edit the generated rules by hand.
On our first start Pyrra logged msg="failed to reload Prometheus" because Prometheus wasn’t listening yet. Nothing was lost: Prometheus read the rule files when it started a moment later. If you edit an SLO and the rules on the Prometheus Status page don’t change, that warning is the first place to look.
Read the burn-rate rules Pyrra writes
Pyrra writes recording rules for the error ratio over 5m, 30m, 1h, 2h, 6h, 1d and 4d, then four multi-window, multi-burn-rate alerts on top of them. The fast-burn rule it generated for availability reads:
- alert: ErrorBudgetBurn
expr: http_server_request_duration_seconds:burnrate5m{job="checkout",slo="checkout-availability"}
> (14 * (1-0.99)) and http_server_request_duration_seconds:burnrate1h{job="checkout",slo="checkout-availability"}
> (14 * (1-0.99))
for: 2m0s
labels:
exhaustion: 2d
job: checkout
long: 1h
severity: critical
short: 5m
slo: checkout-availability
Read it as: the error ratio over both 5 minutes and 1 hour is above 14 times the budget rate, for 2 minutes. At 14x the whole 28 day budget is gone in 2 days, which is what exhaustion: 2d says. The long window proves the problem is real; the short window makes the alert clear quickly once you fix it. All four tiers for the 99% target:
| Short / long window | Burn factor | Error ratio threshold | for | Severity | Budget gone in |
|---|---|---|---|---|---|
| 5m / 1h | 14x | 0.14 | 2m | critical | 2 days |
| 30m / 6h | 7x | 0.07 | 15m | critical | 4 days |
| 2h / 1d | 2x | 0.02 | 1h | warning | 2 weeks |
| 6h / 4d | 1x | 0.01 | 3h | warning | 4 weeks |
The SRE workbook chapter on alerting on SLOs starts from 14.4, 6 and 1 over a 30 day window; Pyrra ships 14, 7, 2 and 1 over 28 days. The thresholds scale with the target, so the latency SLO at 95% gets 0.70, 0.35, 0.10 and 0.05. Tuning these tiers and generating the rules as code gets its own guide on burn-rate alerts with Sloth and Pyrra.
Break checkout on purpose
An alert you’ve never seen fire is a guess. We let the stack run healthy for about 8 minutes, then told the app to fail 40% of checkouts and delay half of them by 600 ms:
curl -s -X POST "localhost:8080/admin/fault?error_rate=0.4&delay_rate=0.5&delay_ms=600"
You get the new fault settings back as JSON. Ours went in at 13:14:24 UTC.
{"delay_ms":600.0,"delay_rate":0.5,"error_rate":0.4}
Run the availability SLI from earlier through the Prometheus API, pinned to 13:30 UTC, and you see how bad it got. On your own stack, drop the time parameter to get the current value, or put in a timestamp from your fault window.
curl -s localhost:9090/api/v1/query --data-urlencode 'query=sum(rate(http_server_request_duration_seconds_count{job="checkout",http_response_status_code!~"5.."}[5m])) / sum(rate(http_server_request_duration_seconds_count{job="checkout"}[5m]))' --data-urlencode 'time=2026-11-12T13:30:00Z' | jq -r '.data.result[0].value[1]'
It prints the success ratio for that moment as a bare number.
0.6115849324804549
About 61% of checkouts succeeded, against an objective of 99%. Before the fault you would have seen exactly 1 from the same query.
Watch the fast burn reach the pager
The slow tiers noticed first. The 4d and 1d warnings went pending within two minutes, and the 6h critical went pending at 13:21:31. The 14x fast burn took longer: its 1h window started full of healthy traffic, so the 1h error ratio had to climb from 0 past 0.14 while the 5m ratio was past 0.14 within a minute and soon near 0.40. It went pending at 13:32:01 and fired at 13:34:01.
That is about 20 minutes from fault to page for a 40% error rate, and the cause is traffic volume. The 600 ms delays slowed the closed-loop load generator from 28.8 to 9.6 requests a second, so the 8 healthy minutes before the fault carried about three times the weight of each bad minute in the 1h ratio. That pushed the crossing past 0.14 out to about 17 minutes. Then the for: 2m on the rule and the 30 second group_wait in Alertmanager add the rest.
If 20 minutes is too slow for your service, raise the target, lower the burn factor or add a tier with a shorter long window, because the threshold is the factor times the allowed error rate. Lowering the target does the opposite and pages later. Don’t drop the long window entirely, since it is what stops a 3 minute blip from paging anyone.
The Pyrra detail page for the availability SLO shows the firing tier with the values Prometheus evaluated, 0.409 over 5m and 0.161 over 1h, both above the 0.140 threshold:

The threshold column reads 0.140, but the explanation text under the table calls it “the 0.14% threshold”. It is a ratio, the same 0.14 that’s in the rule, so don’t let the percent sign send you looking for a bug that isn’t there. On the Prometheus side, the alerts page showed both critical tiers firing by 13:38, after the 6h rule finished its 15 minute for:

Alertmanager grouped both into one page group for slo="checkout-availability". The labels carry everything an on-call engineer needs to triage: which windows tripped and how long until the budget runs out at this rate.

The webhook sink confirms the routing. Both criticals arrived on /page and nothing went to /ticket, because the warnings were still inside their 1h and 3h for periods:
docker compose logs --no-log-prefix alert-sink | grep -v HTTP
Our first notification landed at 13:34:31, 30 seconds after the alert started firing.
/page firing ErrorBudgetBurn critical 1h 2026-11-12T13:34:01.417Z
/page firing ErrorBudgetBurn critical 1h 2026-11-12T13:34:01.417Z
/page firing ErrorBudgetBurn critical 6h 2026-11-12T13:36:31.417Z
You see the 1h alert twice because the 6h alert joined the same group at 13:36:31. At the next group_interval tick Alertmanager saw the group had changed and resent all of it; an unchanged group only repeats after repeat_interval. Your receiver should dedupe on the alert fingerprint rather than page you twice.
Notice what the latency SLO did
Half the requests were slow, yet the latency SLO never paged. Its 14x threshold is 0.70 because the budget is 5%, and a 50% slow rate is only a 10x burn. The 7x tier needs the 30m and 6h windows above 0.35, and they peaked at 0.27 and 0.22. Only the 1d and 4d warnings went pending. That is the design working: a 10x burn on a 95% target exhausts the budget in about 3 days, which belongs in a ticket queue, not on your phone at night.
Follow one failed request from metric to log
The alert tells you users are failing. The correlation links tell you why, without grepping anything. Open Explore in Grafana with the Prometheus data source, switch the query editor to Code and run the p95 latency query.
histogram_quantile(0.95, sum by (le) (rate(http_server_request_duration_seconds_bucket{job="checkout"}[1m])))
Turn on the Exemplars toggle under the query. Diamonds appear along the graph, each one a real request that Alloy forwarded with its trace ID. The p95 line jumps from a few milliseconds to about 0.72 seconds at the fault. Hover a diamond after that jump and check the tooltip:
- Read the trace ID on the exemplar, here a status 500.
- Click Query with Tempo to open the trace.

- 1Trace ID on the exemplar
- 2Open the trace
Grafana splits the view and loads the trace from Tempo. Our failed checkout was a single GET /api/checkout span, marked as an error, that returned 500 in 1.13 ms. It failed fast, so the latency jump came from the other half of the fault. That is exactly the kind of detail a dashboard averages away, and you only see it in the trace. From the trace header:
- Click Related logs to get the logs for this trace.
- On a big trace, click Errors to show only failed spans.

- 1Logs for this trace
- 2Show only failed spans
Related logs runs the provisioned query with the trace ID filled in, {service_name="checkout"} | trace_id="e7678ce376c7b6d399f0fdc6513ef4e4", and Loki returns one line: ERROR payment provider timeout, order rejected. Now you know which dependency to chase. The link works in reverse too:
- Click the line to open it and see its fields.
- Click View trace next to trace_id to go back to the trace.

- 1Click the line to open it
- 2Back to the trace
That round trip, from a latency graph to the trace of one request to its log line and back, took three clicks. It only works because the app, Alloy and Grafana agree on the trace ID field. Spans, attributes and sampling deserve more room than this guide gives them, so keep the field names consistent before you add services.
Read the error budget honestly
The Pyrra SLO list during the fault looked catastrophic. Availability sat at 85.38% against a 99% objective, with the error budget at -1361.79%. Latency was at 80.81% with -283.83% left:

Those numbers are real, but the window behind them isn’t 28 days. Pyrra computes the budget with increase() over the full window, and our Prometheus only held about 30 minutes of data. So 4,141 errors out of 28,333 requests is a 14.6% error ratio over the data that exists, which is 14.6 times the 1% budget, and the remaining budget reads 1 minus 14.6, or about -1360%. On a fresh install, every incident looks like the end of the world for the first few weeks.

Against a full month of history the same incident is small. The share of budget an incident consumes is error ratio times duration, divided by the window, divided by the allowed error rate:
budget consumed = error_ratio * incident_minutes / window_minutes / (1 - target)
= 0.40 * 24 / 40320 / 0.01
= 0.024 (2.4% of the 28 day budget)
Our fault ran for 24 minutes, from 13:14:24 to 13:38:44 UTC, and the formula assumes steady traffic, so it overstates our lab incident a little since volume fell during the fault. So a 24 minute outage that hit 40% of checkouts used about 2.4% of the monthly budget. That’s worth a postmortem but not a freeze. Share both views with your team before the first real incident, so nobody panics at a negative number on week one.
Turning the fault off is the same call with zeros.
curl -s -X POST "localhost:8080/admin/fault?error_rate=0&delay_rate=0"
The 1h fast burn cleared within about three minutes, because its 5m window dropped under 0.14 almost at once. The 6h critical kept firing, since its 30m window still held the bad traffic. That is the job of the short window, which decides how fast an alert resolves after you fix things. The sink logged the resolve on the same receiver:
/page resolved ErrorBudgetBurn critical 1h 2026-11-12T13:34:01.417Z
/page firing ErrorBudgetBurn critical 6h 2026-11-12T13:36:31.417Z
Keep send_resolved on (it’s the webhook default) so on-call sees the page close without opening Grafana.
Write the error budget policy
Alerts without a policy only give you arguments. The policy says in advance what each burn level costs the team, so nobody negotiates during an incident. This short template maps straight onto the four tiers Pyrra generates:
| Trigger | Budget gone in | Response |
|---|---|---|
| 14x burn (5m/1h) fires | 2 days | Page on-call. Stop deploys to the service until it clears. |
| 7x burn (30m/6h) fires | 4 days | Page on-call. Roll back the last change first, debug second. |
| 2x burn (2h/1d) fires | 2 weeks | Ticket for the owning team, triaged the next working day. |
| 1x burn (6h/4d) fires | 4 weeks | Ticket. Review at the weekly reliability meeting. |
| Remaining budget under 25% | n/a | Feature work pauses; reliability fixes go first until it recovers. |
| Budget exhausted | n/a | Release freeze except fixes, plus a postmortem for each burn over 5%. |
Put the policy where the alert links to it, have the product owner sign it, and review the target every quarter. If the team blows the budget every month and nobody minds, the target is wrong. If it never moves, you’re probably shipping too carefully.
Fix the errors we hit
These are the problems the lab threw at us, with the exact messages, so you can search for them.
Loki or Tempo exits with “permission denied” on its config file
Loki and Tempo run as non-root users inside their images. We copied the config files over with a restrictive umask, so they arrived as mode 600 and both containers quit at start.
loki-1 | failed parsing config: open /etc/loki/loki.yaml: permission denied. Use `-config.expand-env=true` flag if you want to expand environment variables in your config file
tempo-1 | failed parsing config: failed to read configFile /etc/tempo.yaml: open /etc/tempo.yaml: permission denied
The Loki hint about -config.expand-env is a red herring. Make the files world-readable with the chmod 644 line from the bring-up step, keep .env at 600, and run docker compose up -d again.
Alloy logs “lookup loki on 127.0.0.11:53: server misbehaving”
You’ll see this while Loki and Tempo are crash-looping. The embedded Docker DNS only answers for containers that are running, so the Alloy exporters couldn’t resolve the backends and kept retrying:
level=info msg="Exporting failed. Will retry the request after interval." component_path=/ component_id=otelcol.exporter.otlphttp.loki error="failed to make an HTTP request: Post \"http://loki:3100/otlp/v1/logs\": dial tcp: lookup loki on 127.0.0.11:53: server misbehaving"
Treat it as a symptom, not a cause. Check docker compose ps for the backend that isn’t Up and fix that one. Alloy’s exporters retried on their own and the errors stopped once Loki and Tempo were running.
Grafana starts without the provisioned data sources
Grafana reads provisioning files only at startup. When it came up before we’d fixed the file modes, it had no data sources and the exemplar and trace links had nowhere to point. Restart just that service after you fix the files.
docker compose restart grafana
After the restart, Connections then Data sources lists Prometheus, Tempo and Loki with the uids from the file. If exemplars still show no “Query with Tempo” button, the Prometheus data source is missing its exemplarTraceIdDestinations block, or Prometheus is running without --enable-feature=exemplar-storage.
Harden the lab before it carries real traffic
What you have now proves the loop: an SLI, an SLO, a burn-rate page that fired for the right reason, and a three-click path from that page to the failing dependency. Before you point production services at it, close these gaps:
- Move Loki and Tempo to object storage.
- Back up the Prometheus volume or move metrics to Mimir.
- Add
restart: unless-stoppedto every service. - Swap the webhook sink for real receivers and add a dead man’s switch alert.
- Put Grafana behind TLS and SSO.
- Keep the other UIs on localhost or a private network.
- Add a black-box probe so the SLOs see outages the app can’t report.
- Set trace sampling in Alloy before traffic grows.
The probe matters most. An app that’s down sends no telemetry at all, so request-based SLIs go quiet instead of red. Our guide to website uptime checks with the Blackbox exporter adds that outside view, and the Linux server uptime walkthrough covers the host side. For the Rocky Linux and AlmaLinux versions of the backends, see the guides for Loki, Tempo and Mimir.
For the reasoning behind error budgets and on-call policy, the picks in our SRE book guide are worth the time. The observability and OpenTelemetry books go deeper on tracing, and the Grafana and Prometheus books cover PromQL and dashboard design. Start with the SLO tiers you saw fire here, then tune the targets once a month of real data has filled the window.