Self-test
Check your PromQL
Self-test12 questions
What's the difference between an instant vector and a range vector? Why can't a graph draw a range vector?
{env!="prod"}returns series from a job that has noenvlabel at all. Why?Name the three things
rate()does that a naive "(last - first) / time" calculation doesn't.Why must you
rate()before yousum(), and what would go wrong the other way round when one instance restarts?Your scrape interval is 30s and a panel uses
rate(x[30s]). What do you see, and what's the fix in Grafana?Write the error ratio per route for the demo app. Then explain why removing
by (route)from only the denominator returns nothing.Write a query that attaches the
versionlabel fromapp_build_infoto the per-instance request rate. What doesgroup_leftmean here?Why must
lesurvive the aggregation insidehistogram_quantile? What's wrong withavg(histogram_quantile(0.99, ...))?Your p99 panel shows exactly
5for an hour. What does that most likely mean?Why is "fraction of requests under 300 ms" a better SLO measurement than "p99 under 300 ms"?
Write an alert expression that fires if the demo app's
upseries disappears completely, not just when it's 0.- Design question
A dashboard showing 30 days of
max_over_time(sum(rate(x[5m]))[1d:15s])takes 40 seconds to load. Walk through how you'd make it fast.