Free — no signup required

Grafana Annotations: Correlating Events with Metrics

1 min read

"What Changed at 2:00 PM?"

You see a latency spike on your dashboard. Your first instinct is to ask: did we deploy? Did a cron job run? Did a pod restart? Without context, you are guessing.

Annotations are vertical lines drawn across all panels in a dashboard at specific timestamps. They mark events so you can visually correlate "something happened here" with "the graph changed here."

Annotation Sources

From Prometheus: a query that counts changes in process_start_time_seconds over a short window detects pod restarts. Every time this query returns a non-zero value, Grafana draws a vertical line at that timestamp. You can instantly see: "The latency spike started exactly when three pods restarted."

From a SQL database or CI/CD system: Grafana can query a PostgreSQL or MySQL database for deployment records, selecting the deployment timestamp, service name, and version, filtered to the dashboard's visible time range. Now every deployment appears as a labeled vertical line on your graphs.

Why This Matters

Annotations transform dashboards from passive monitors into active investigation tools. The moment you can see "deploy happened → latency spiked → error rate increased" on a single screen, your mean time to diagnosis (MTTD) drops dramatically. This is the difference between a dashboard that shows you what is happening and one that helps you understand why.

This is one of 18 chapters

Every chapter is free — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

Sign up free