Learn Labs
PromQL

Self-test

Check your PromQL

Self-test12 questions

—/12
  1. What's the difference between an instant vector and a range vector? Why can't a graph draw a range vector?

  2. {env!="prod"} returns series from a job that has no env label at all. Why?

  3. Name the three things rate() does that a naive "(last - first) / time" calculation doesn't.

  4. Why must you rate() before you sum(), and what would go wrong the other way round when one instance restarts?

  5. Your scrape interval is 30s and a panel uses rate(x[30s]). What do you see, and what's the fix in Grafana?

  6. Write the error ratio per route for the demo app. Then explain why removing by (route) from only the denominator returns nothing.

  7. Write a query that attaches the version label from app_build_info to the per-instance request rate. What does group_left mean here?

  8. Why must le survive the aggregation inside histogram_quantile? What's wrong with avg(histogram_quantile(0.99, ...))?

  9. Your p99 panel shows exactly 5 for an hour. What does that most likely mean?

  10. Why is "fraction of requests under 300 ms" a better SLO measurement than "p99 under 300 ms"?

  11. Write an alert expression that fires if the demo app's up series disappears completely, not just when it's 0.

  12. 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.