Add variables and adjust layouts
Work through this guide when you need to make dashboards easier to reuse and read. It shows you how to introduce variables, tidy layouts, and prepare dashboards for sharing or cloning.
What you’ll achieve
- Add one or more dashboard variables that reflect the labels or dimensions your team filters on.
- Restructure panels into logical groups so viewers can scan the page quickly.
- Capture documentation you can reuse when cloning the dashboard for other environments.
Before you begin
- Dashboard in edit mode: Keep the target dashboard open.
- Variable plan: Know which labels, regions, or teams you want to filter on.
Introduce dashboard variables
Describe the filters your viewers rely on and ask Grafana Assistant to generate matching variables, then connect those variables to the panels that need them.
- Ask Grafana Assistant to create variables that match your filtering needs. Be specific about the label keys and provide example values when possible.
Add a multi-select variable called region that lists distinct values from label "region" in @prometheus-ds.
- Confirm that the variable appears in the Dashboard settings and renders in the header.
- Update relevant panels to reference the variable, for example,
Use $region in the latency panel query
.
Organize the layout
Rearrange panels into clear sections and enforce consistent sizing so teammates can scan the dashboard quickly.
- Request layout adjustments to group related panels:
Arrange the error-rate panels in a single row and move health checks below them.
- Ask for consistent sizing and spacing if panels overlap or stretch awkwardly.
- Use the Assistant to generate descriptive panel titles and legends so viewers understand the intent.
- Break complex layout changes into sequential prompts and correct the Assistant politely if a panel lands in the wrong row or column.
Prepare the dashboard for reuse
Capture documentation and exports so others can clone the dashboard without rebuilding it from scratch.
- Ask the Assistant to document the dashboard structure and variables in plain language.
- If this layout should become a template, request JSON export instructions or ask the Assistant to save a copy with a new name for another environment.
- When you move on to a different dashboard or topic, start a new conversation so previous context does not interfere with the next request.
Confirm the dashboard is ready for reuse
You now have a dashboard with reusable variables, organized panels, and documentation your team can follow. Store the summary with the dashboard so future editors understand the design choices.
Troubleshooting
- Variable not populating: Confirm the data source supports label queries and that the Assistant selected the right label name.
- Layout changes not visible: Refresh the dashboard or ensure the Assistant has edit mode access.
- Variable not referenced: Ask the Assistant to audit queries and inject
$variable
placeholders where appropriate.
Next steps
- Share completed dashboards using Navigation to help teammates find your work.
- Analyze dashboard data with Data analysis workflows.