Course contentsShow
← Cloud and Infrastructure
Lesson 2107 of 2,98945. Observability - Dashboards and SLOsFree lesson

Dashboard Variables and Filters

Use dynamic variables to create reusable, interactive dashboards that filter data across multiple panels.

Dashboard Variables and Filters

You'll learn how to make your dashboards adaptable and reusable by letting users dynamically filter data without rebuilding panels.

When you create dashboards for multiple environments, teams, or services, building separate dashboards for each context becomes tedious and hard to maintain. Dashboard variables solve this by introducing placeholders that users can change on-the-fly, instantly updating all panels that reference them.

What Are Dashboard Variables?

Think of variables as fill-in-the-blank fields at the top of your dashboard. Instead of hardcoding service="checkout" in every panel, you define a variable $service that can be checkout, payment, or inventory. Users select from a dropdown, and every visualization updates automatically.

Variables typically pull their values from:

  • Query results: List all Kubernetes namespaces, AWS regions, or service names from your metrics
  • Static lists: Predefined options like environment names (prod, staging, dev)
  • Custom inputs: Free-form text for ad-hoc filtering

How Filters Enhance Interactivity

While variables provide top-level controls, filters let users drill down further. For example:

  1. Select $region variable → us-east-1
  2. All panels now show only data from that region
  3. Click a specific service in a panel → filter entire dashboard to that service temporarily

This cascading behavior turns static reports into interactive investigation tools. You maintain one dashboard template instead of dozens of duplicates.

Common Patterns

  • Use $environment to switch between production and staging
  • Chain variables: $cluster → $namespace → $pod
  • Apply multi-select: monitor five services simultaneously
  • Set URL parameters to share filtered views with teammates

Key Takeaway:
Dashboard variables transform rigid visualizations into flexible, reusable templates—one dashboard adapts to countless contexts through dynamic filtering, eliminating duplication and accelerating troubleshooting.