World map

 

BM: Baca dalam Bahasa Melayu

World O3: Alarms & Screens

Variables and templating

You will learn: to make one dashboard serve every shop with a drop-down.

Checked with Prometheus 3 on 1 Nov 2026

The problem

Kedai Kancil has two shop servers, and soon five. Do you build one dashboard per shop?

Pick one answer.

Watch

You picked shop-1 and shop-2. Grafana swaps $instance before Prometheus sees it. Write what Prometheus gets.

Type a PromQL query and press Run. The table shows the answer at the eval time. The graph shows it over time.

Metrics in this data (tap to add):

Time 0 is when the data starts. The query looks back from the eval time.

A dashboard variable: A drop-down at the top of a Grafana dashboard. Pick shop-2 and every panel's query swaps $instance for shop-2. is that drop-down. Every panel reads it.

Try it

Build a panel query that follows the drop-down. Tap the pieces in order.

Tap the pieces in the right order.

…

Predict

Two shops are picked. A panel says instance="$instance", with one =. What does it show?

Pick one answer.

Check

Drag a card into a box. Or tap the card, then tap the box.

      $__rate_interval only works inside Grafana. Rules run in Prometheus, so they use a fixed window.

      You did it!

      You can now make one dashboard serve every shop with a variable.

      Go deeper (optional)

      Make the variable a Query variable: type Label values, label instance, metric up. Turn on Multi-value and Include All. Variables can chain: pick a job, and the instance list shrinks to match.

      Real mission

      0 of 3 steps done · Your ticks are saved.