Field Notes: Observability That Helps at 3 a.m.
Tools are the easy part. These notes are the habits that decide whether, during an incident, the dashboards and alerts actually lead somewhere, collected from running them.
Instrument before you need it
The worst time to add metrics is during an outage, when every deploy is risky. Every new service ships with RED metrics, a build-info metric, JSON logs with trace_id, OTel tracing and a dashboard before it takes traffic. Make it a checklist item in the service template, not a good intention.
One label vocabulary across all signals
If metrics say service="linkly", logs say app="link-shortener" and traces say service.name="linkly-api", every jump between signals needs a human to translate. Pick one set (service, env, cluster, namespace, version) and enforce it at the collection layer: relabeling in Prometheus, resource processors in the Collector, Alloy stages. Grafana's cross-links only work when the values match exactly.
Test the whole alert path, not just the rule
An alert can be correct in promtool and still reach nobody: a route catches it first, a receiver's secret expired, the label the route needs isn't on the alert. Test rule → labels → route together in CI. This script takes each alert that the rule tests expect to fire, with its labels, and asks Alertmanager's routing tree where it would go:
cat > alerts.yml <<'YML'
groups:
- name: linkly
rules:
- alert: LinklyDown
expr: up{job="linkly"} == 0
for: 2m
labels: {severity: page, team: links}
- alert: LinklyCertExpiring
expr: probe_ssl_earliest_cert_expiry{job="blackbox"} - time() < 14 * 86400
labels: {severity: ticket} # forgot team: links
YML
cat > alertmanager.yml <<'YML'
route:
receiver: catch-all
routes:
- matchers: [severity="page", team="links"]
receiver: links-pagerduty
- matchers: [severity="ticket", team="links"]
receiver: links-tickets
receivers:
- name: catch-all
- name: links-pagerduty
- name: links-tickets
YML
cat > expectations.txt <<'TXT'
LinklyDown links-pagerduty
LinklyCertExpiring links-tickets
TXT
# the labels each alert carries = the rule's labels (series labels omitted for brevity)
fail=0
while read -r alert want; do
labels=$(yq -r ".groups[].rules[] | select(.alert == \"$alert\") | .labels | to_entries | map(.key + \"=\" + .value) | join(\" \")" alerts.yml)
got=$(amtool config routes test --config.file=alertmanager.yml alertname="$alert" $labels)
if [ "$got" = "$want" ]; then echo "ok $alert -> $got"; else echo "FAIL $alert -> $got (want $want)"; fail=1; fi
done < expectations.txt
exit $failok LinklyDown -> links-pagerduty
FAIL LinklyCertExpiring -> catch-all (want links-tickets)
The certificate alert lands in catch-all, a receiver nobody reads, because a label is missing. That bug is invisible to promtool test rules and to amtool check-config separately. Run a real end-to-end test in staging too: fire a test alert (amtool alert add) and check that the phone rings.
Dashboards: fewer, layered, with a purpose
- One overview per service with RED at the top, saturation of each dependency below, and deploy annotations; drill-down dashboards linked from it.
- Every panel answers a question; the title says which ("Is linkly failing requests?" beats "http_requests_total").
- Show the SLO threshold as a line on the panel; colour by it.
- Delete dashboards nobody opened in 90 days (Grafana's usage insights or the
dashboardview counts). A folder of 200 stale dashboards is where incidents go to waste time.
Mark changes on graphs
Most incidents start with a change. Push annotations for deploys, config changes, feature-flag flips and scaling events (Grafana's annotation API from the CD pipeline, or a linkly_build_info query as an annotation source). "Errors started at 14:05" becomes "errors started with release 1.5.0" at a glance.
Budget telemetry like any other cost
Observability bills grow quietly: a new label, debug logging left on, 100% trace sampling on a busy endpoint. Watch the volumes as metrics: active series per job (count by (job) ({__name__=~".+"}) is expensive, use prometheus_tsdb_head_series and the TSDB status page), log bytes per app (sum by (app) (bytes_over_time({app=~".+"}[1h])) in Loki), spans per service. Alert on sudden growth like on any other anomaly, and give each team the numbers for their own services.
Keep the monitoring alive when everything else is down
- Run the monitoring stack where the outage isn't: a separate cluster or at least separate nodes; Prometheus can't alert on the cluster it's dying with.
- A dead man's switch (the always-firing Watchdog alert to an external service) tells you when alerting itself stopped.
- External synthetic probes (blackbox from another region, or a hosted uptime checker) see what users see when your internal view is blind.
- Write the runbook's first step for "Grafana is down": the Prometheus UI,
logcliandamtoolstill work from a laptop with a port-forward.
Keep personal data out
Logs and traces end up in more places, kept longer and seen by more people than the database. Redact at the source (don't log tokens, mask emails), and again in the pipeline (the Collector's attributes/redaction processors, Alloy stages) as a safety net. Set retention deliberately per signal, and document it for your privacy review.
Test yourself
An alert rule passes its promtool tests but nobody was paged when it fired. What did the end-to-end routing test in this lesson catch?
- A PromQL error
- The alert lacked a label the routing tree needed, so it went to an unread catch-all receiver
- Alertmanager was down
- The
forwas too long
Why push deploy annotations to Grafana?
- For decoration
- Most incidents follow a change; seeing it on the graph shortens diagnosis
- Grafana requires them
- To trigger alerts
Why run monitoring outside the cluster it monitors?
- It's cheaper
- So it still works and alerts when that cluster fails
- Kubernetes forbids it
- For better dashboards