What is the Difference Between a Grafana Dashboard and a Panel?
Learn the difference between a Grafana dashboard and a panel, how template variables work, and why dashboards are reusable JSON.
Expected Interview Answer
A Grafana dashboard is the overall page — a saved collection of visualizations, layout, and shared settings like time range and template variables — while a panel is a single visualization within that dashboard, such as one graph, gauge, or table backed by one or more queries.
A dashboard is stored as one JSON document containing an array of panel definitions plus dashboard-level settings: the default time range, refresh interval, and template variables like $environment or $service that every panel on the page can reference. Each panel independently defines its own data source, one or more queries (PromQL, SQL, etc.), and a visualization type — time series, bar gauge, heatmap, table, or stat — along with its own thresholds and unit formatting. Because template variables live at the dashboard level, changing the $environment dropdown at the top instantly re-queries every panel that references it, without editing each panel individually. This separation is what lets teams build one reusable dashboard template that shows the same layout for staging, production, or any other environment just by switching a variable.
- One dashboard reuses shared time range and variables across many panels
- Panels can be added, resized, or removed independently
- Template variables make dashboards reusable across environments
- Panels can mix different data sources and visualization types on one page
AI Mentor Explanation
A Grafana dashboard is like a full team scoreboard display at the ground, showing multiple individual scoreboards side by side — batting figures, bowling figures, and the run rate graph — all sharing the same match date and innings selector at the top. Each individual scoreboard is a panel, independently pulling and displaying its own specific stat. Changing the innings selector at the top of the display instantly updates every scoreboard beneath it at once. One venue’s scoreboard layout can be reused for any match just by swapping which teams are selected.
Step-by-Step Explanation
Step 1
Create a dashboard
Set dashboard-level defaults: time range, refresh interval, and template variables.
Step 2
Add panels
Each panel picks a data source, writes its own query, and chooses a visualization type.
Step 3
Wire variables
Reference dashboard variables like $environment inside panel queries so panels stay in sync.
Step 4
Arrange and save
Resize and position panels on the grid, then save the dashboard as one reusable JSON document.
What Interviewer Expects
- Clear distinction: dashboard is the page/container, panel is one visualization
- Understanding of template variables and how they cascade to all panels
- Awareness that panels can use different data sources and query languages
- Knowledge that dashboards are portable JSON that can be templated/reused
Common Mistakes
- Using “dashboard” and “panel” interchangeably
- Not using template variables, leading to duplicated dashboards per environment
- Assuming all panels on a dashboard must share one data source
- Forgetting dashboards are stored as JSON and can be version-controlled
Best Answer (HR Friendly)
“A Grafana dashboard is the whole page you look at, and a panel is one chart or graph on that page — like CPU usage or error rate. What makes dashboards powerful is that you can set a variable like environment once at the top, and every panel underneath updates automatically, so we can reuse one dashboard for staging and production instead of building two separate ones.”
Code Example
apiVersion: 1
providers:
- name: "default"
folder: "DevOps"
type: file
options:
path: /var/lib/grafana/dashboards
# Inside the dashboard JSON (conceptual excerpt):
# templating.list includes a variable named “environment”
# panel queries reference it as: rate(http_requests_total{env="$environment"}[5m])Follow-up Questions
- How do template variables cascade to every panel on a dashboard?
- Can panels on the same dashboard use different data sources?
- How would you version-control Grafana dashboards as code?
- What is the difference between a panel query and a dashboard-level variable query?
MCQ Practice
1. What is a Grafana panel?
A panel is one visualization on a dashboard, such as a graph or table, with its own query and settings.
2. What lets one dashboard be reused across staging and production without duplication?
Template variables like $environment let panel queries dynamically adapt when the variable value changes, avoiding duplicate dashboards.
3. How is a Grafana dashboard typically stored?
A Grafana dashboard is serialized as JSON containing panel definitions and dashboard-level settings, which can be version-controlled.
Flash Cards
What is a Grafana dashboard? — The overall saved page containing panels, layout, and shared settings like time range and variables.
What is a Grafana panel? — A single visualization within a dashboard, backed by its own query and data source.
What are template variables for? — To let one dashboard dynamically adapt across environments without duplication.
How are dashboards stored? — As a single JSON document that can be version-controlled and provisioned as code.