Exercise 2: Collapsing 15 Dashboards Into One via a Template Variable — Possible Solution ==================================================================== Panel query, using a $service template variable: sum(rate(http_requests_total{job="$service"}[5m])) -- How a template variable replaces 15 separate dashboards -- -- -- Right now, the team has effectively hand-built the SAME dashboard -- 15 times, once per microservice, differing only in which specific -- job/service name each dashboard's queries happen to hardcode. A -- $service template variable replaces that hardcoded value with a -- dropdown at the top of a single dashboard, populated by a -- label_values() query against Prometheus's own job label (the exact -- label obs1-3's own scrape_configs automatically attaches to every -- metric). Every panel's query -- request rate, error rate, latency, -- whatever the original 15 dashboards each repeated -- gets written -- ONCE, referencing $service instead of any one specific service -- name. Selecting a different value from the dropdown re-runs every -- panel's query with that new value substituted in, showing the same -- dashboard layout for whichever service was picked, with no need to -- maintain 15 separate copies that would otherwise all have to be -- updated in lockstep every time a panel changes. WHY THIS WORKS AS AN ANSWER ------------------------------ This writes a correctly parameterized panel query using $service in place of a hardcoded job name, then explains concretely how the existing 15-dashboard duplication collapses into one dashboard plus a dropdown, directly tying the fix back to the job label obs1-3 established scrape_configs attaches automatically.