A Grafana dashboard turns raw metrics into something a human can act on at 3 a.m. When a service starts failing, nobody opens a terminal and reads a wall of numbers. They open a dashboard, and within seconds they need to know three things: what is broken, how bad it is, and whether it is getting worse. A well-built dashboard answers all three. A badly built one adds noise to an incident that is already stressful enough.
This tutorial walks you through building Grafana dashboards the way working DevOps engineers actually do it. You will install Grafana, connect it to Prometheus, build a dashboard panel by panel, add template variables so one dashboard serves every environment, wire up alerts, and finally manage the whole thing as code so it survives the next rebuild. Everything here is tested against Grafana 13.3.2, the latest stable release as of 24 November 2026. If you are running an older version, the concepts are identical; only a few menu labels may differ.
By the end you will have a production-shaped dashboard for a web service: request rate, error rate, latency percentiles, CPU and memory, and a panel that shows which instances are unhealthy.
What a Grafana Dashboard Is and How It Works
Grafana itself does not collect metrics. That surprises people who are new to observability, so it is worth stating plainly. Grafana is a visualisation and alerting layer. It queries data sources, such as Prometheus, Loki, InfluxDB or a SQL database, and renders the results as panels on dashboards. The data lives elsewhere; Grafana asks questions and draws pictures of the answers.
A dashboard is a collection of panels arranged in rows on a grid. Each panel runs one or more queries against a data source and renders the result as a time series graph, a single number, a gauge, a table, a heatmap or a bar chart. Panels can share a time range, which is controlled by the time picker in the top right of the dashboard. Change the range to the last six hours and every panel updates together. That shared context is what makes a dashboard useful during an incident: every chart is looking at the same window of time.
Behind the scenes, a dashboard is a JSON document. Every panel, query, threshold and layout choice is stored as JSON, which means dashboards can be versioned in Git, reviewed in pull requests and deployed by automation. The official Grafana dashboard documentation describes the full JSON model and every panel option.
Grafana organises dashboards into folders, and access is controlled by organisations, folders and dashboard permissions. In a small team, one organisation with a few folders is enough. In a larger setup, you might give each team its own folder and restrict editing to that team. Start simple. You can always add structure later, but untangling a mess of permissions after the fact is painful.
Before you build anything, decide what the dashboard is for. The best dashboards answer one question well. A dashboard called "API overview" that shows request rate, error rate and latency for one service is useful. A dashboard called "Everything" that shows fifty panels for twelve services is a wall of noise that nobody reads. If you find yourself adding a panel and struggling to explain why it belongs there, it probably does not. A useful test is to imagine paging someone with this dashboard open: would the panel help them decide what to do next? If not, leave it out.
The classic starting point for a web service is the four golden signals: latency, traffic, errors and saturation. Latency tells you how slow things are. Traffic tells you how much demand there is. Errors tell you how often things fail. Saturation tells you how close you are to running out of a resource. If your dashboard covers those four for one service, you have a dashboard worth keeping. Everything else is a bonus.
Installing Grafana and Connecting Prometheus
The fastest reliable way to run Grafana for learning is Docker. One container gives you a clean install you can throw away and recreate, and it keeps your laptop free of stray packages. The command below starts Grafana 13.3.2 on port 3000 with a persistent volume so your dashboards survive a container restart.
docker volume create grafana-data docker run -d --name grafana \ -p 3000:3000 \ -v grafana-data:/var/lib/grafana \ grafana/grafana:13.3.2 Open http://localhost:3000 in your browser and sign in with the default credentials, admin and admin. Grafana will immediately ask you to change the password. Do it, and store the new password in your password manager. The default admin password is the first thing any attacker tries, and a Grafana instance exposed to the internet with default credentials is a genuine security incident waiting to happen.
If you would rather install Grafana on a Linux server, Grafana Labs publishes official packages for Debian, Ubuntu, Red Hat and SUSE, plus a standalone binary. The package install creates a systemd service, so you manage it with the usual commands: sudo systemctl enable --now grafana-server to start it and enable it at boot, and sudo systemctl status grafana-server to check it is running. The configuration file lives at /etc/grafana/grafana.ini, and the data directory defaults to /var/lib/grafana. If you want a refresher on how services like this are managed on Linux, our Linux commands guide for DevOps engineers covers the systemctl workflow in detail.
Next you need data. A dashboard without a data source is an empty frame, so connect Prometheus before you build anything. Prometheus is the most common pairing with Grafana, and if you followed our Prometheus and Grafana monitoring tutorial, you already have a Prometheus server scraping targets. If not, you can run one quickly with Docker and point it at itself for practice data.
docker run -d --name prometheus \ -p 9090:9090 \ prom/prometheus:v3.0.0 To add Prometheus as a data source, go to Connections, then Data sources, then Add data source, and choose Prometheus. Set the URL to the address of your Prometheus server, for example http://localhost:9090 if Prometheus runs on the same machine, or http://prometheus:9090 if both are in the same Docker network. Leave the access mode on Server, which means Grafana queries Prometheus from the backend rather than from your browser. Server access is the right default: it keeps credentials out of the browser and works when Prometheus is not reachable from your laptop. The Prometheus data source documentation lists the full set of connection options. Click Save and test. Grafana runs a small query and reports success. If the test fails, check the URL first, then check that Prometheus is actually running by opening its own interface on port 9090.
Set a sensible default refresh interval for each dashboard. A five-minute refresh is reasonable for most operational dashboards; a five-second refresh on a dashboard with twenty panels will hammer your data source for no benefit.
Building Your First Dashboard Step by Step
With Grafana running and Prometheus connected, create your first dashboard. Click Dashboards, then New, then New dashboard. You will see an empty canvas with an Add visualization button. Click it, choose Prometheus as the data source, and you are looking at the panel editor. This editor is where you will spend most of your dashboard-building time, so it is worth learning its layout: the query editor at the bottom, the visualisation picker on the right, and the panel options, thresholds and overrides in the right-hand sidebar.
Start with the simplest useful panel: request rate. If your Prometheus server scrapes a web application that exposes an http_requests_total counter, the query rate(http_requests_total[5m]) gives you requests per second over a five-minute window. If you only have Prometheus scraping itself, use rate(prometheus_http_requests_total[5m]) instead; the mechanics are identical. Choose the Time series visualisation, set the panel title to "Request rate", and set the unit to "requests/sec" under Standard options. That unit setting matters more than people expect: without it, Grafana shows a bare number and the reader has to guess what it means. With it, the axis is labelled and the tooltip reads clearly.
Now add a second panel for error rate. The query below divides the rate of error responses by the rate of all responses, giving you a ratio you can display as a percentage.
sum(rate(http_requests_total{status=~"5.."}[5m])) / sum(rate(http_requests_total[5m])) Set the unit to Percent (0-1) if your query returns a ratio, or Percent (0-100) if it returns a number out of a hundred. Getting this wrong is one of the most common beginner mistakes: a panel that claims your error rate is 400 percent is not alarming, it is misconfigured. Check the unit every time you write a ratio query.
Repeat the pattern for latency. A good latency query uses a histogram if your application exposes one. The query histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket[5m])) by (le)) gives you the 95th percentile latency, which is the number that matters in practice. Averages hide the experience of your slowest users; percentiles reveal it. If your application does not expose a histogram, the average latency from a summary metric is a starting point, but adding histogram instrumentation should be on your list.
Arrange the three panels in a row across the top of the dashboard. This top row is the most valuable real estate you have: it is what someone sees first, and it should answer the question "is the service healthy?" in under five seconds. Put the golden signals there, and push detailed breakdowns further down. A good layout tells a story from top to bottom: health first, then detail, then deep diagnostics at the bottom for the rare occasions someone needs them.
Save the dashboard with a clear name, such as "Web API overview", and add a description explaining what service it covers and who owns it. Descriptions feel like paperwork until the day someone new joins the team and finds forty dashboards with names like "test", "final" and "final v2". Name things as if a stranger will need to find them, because eventually one will.
Panels That Actually Help: Time Series, Stat, Gauge and Table
Grafana ships with many visualisation types, and beginners often try all of them at once. Resist that. Four visualisations cover the large majority of operational dashboards, and learning when to use each one is more valuable than knowing that a dozen exist.
The time series panel is the default and the workhorse. Use it whenever the shape of a metric over time matters: request rate rising, latency spiking, memory creeping upward. A time series shows trends, and trends are what let you distinguish a brief spike from a slow leak. Configure the line width to 1 or 2, keep the fill opacity low so overlapping series stay readable, and add a legend at the bottom with the values set to show the last value and the maximum. A legend without values forces the reader to hover over every line to learn anything; a legend with last and maximum values answers most questions at a glance.
The stat panel shows a single number, large and unmissable. Use it for the numbers that define health: current error rate, active users, queue depth, or the number of unhealthy instances. A stat panel with a coloured background threshold is the closest thing Grafana has to a traffic light. Set thresholds so the panel turns amber and then red as the value crosses the levels you care about. Avoid stat panels for metrics whose current value means nothing without history: a single CPU reading cannot tell you whether usage is rising or falling.
The gauge panel is similar to a stat panel but shows the value against a range, which makes it good for saturation metrics: disk usage as a percentage of capacity, memory usage, or connection pool utilisation. A gauge answers the question "how close are we to the limit?" at a glance. Keep gauges for metrics with a meaningful maximum. A gauge for request rate, which has no natural maximum, is decoration rather than information.
The table panel is for lists: the top ten endpoints by error count, instances sorted by memory usage, or deployments and their versions. Tables are underused in dashboards, partly because they look less impressive than graphs. In practice, a table is often the fastest route to an answer during an incident. When someone asks "which instance is failing?", a graph showing all instances makes them hunt; a table sorted by error count puts the answer at the top. Add a data link to a table row where it helps, for example linking an instance name to its logs, so the dashboard becomes a starting point for investigation rather than a dead end.
Whatever visualisation you choose, apply the same discipline to thresholds. A threshold should mean something operational. Setting a red threshold on CPU at 80 percent is sensible if you know that above 80 percent your latency degrades. Setting it at 80 percent because 80 is a round number is superstition.
Variables, Templating and Multi-Environment Dashboards
The moment you have a second environment, copy-pasting dashboards becomes a liability. You end up with one dashboard for production, one for staging, and one for development, and every improvement has to be made three times. Template variables solve this. A variable is a dropdown at the top of the dashboard whose value is substituted into every query. One dashboard, one set of panels, and a dropdown that switches it between environments, services or regions.
Create a variable from the dashboard settings, under Variables. The most common type is a query variable: a PromQL query that returns a list of values. To build an environment variable, use a query such as label_values(http_requests_total, environment), which returns every value of the environment label. To build a service variable, use label_values(http_requests_total, service). Grafana populates the dropdown from the query results, so the list stays accurate as your infrastructure changes.
Use the variable in your queries with the dollar syntax. A query that was rate(http_requests_total[5m]) becomes rate(http_requests_total{environment="$environment", service="$service"}[5m]). When you switch the dropdown, every panel updates. You can also set a variable to multi-value, which lets the reader select several environments at once, and to "include all", which adds an All option that matches everything.
Variables can depend on each other. A service variable can be filtered by the selected environment, so choosing production only offers services that exist in production. This is called a chained variable, and it prevents the confusing state where a dropdown offers a combination that returns no data. Set the query for the dependent variable to something like label_values(http_requests_total{environment="$environment"}, service) and Grafana refreshes it whenever the environment changes.
Two practical tips make variables work smoothly. First, give every variable a clear label, because the variable name is what appears in the dropdown and names like "var1" help nobody. Second, test the dashboard with each value of the variable, including the All option. A query that works for one service can break for another if labels differ between services, and finding that out during an incident is the worst possible time.
Variables also make dashboards reusable across teams. A platform team can build one dashboard for HTTP services and every service team can use it by selecting their service from the dropdown. That shared dashboard becomes a standard: the same golden signals, the same thresholds, the same layout, everywhere. Consistency like that is worth more than any individual panel, because it means an engineer paged for an unfamiliar service already knows where to look.
Alerting and Dashboard as Code
A dashboard that nobody watches is a poster. Alerting is what turns it into a monitoring system. Grafana Alerting lets you define alert rules on the same queries your panels use, and it can notify Slack, email, PagerDuty or a webhook when a condition holds. The important design decision is what to alert on. Alert on symptoms that users feel, not on causes you guess. "Error rate above 5 percent for five minutes" pages someone because users are experiencing failures. "CPU above 90 percent" pages someone because a number crossed a line, even if users are unaffected. Symptom-based alerts produce fewer pages and more trust.
Create an alert rule from a panel by choosing Alert in the panel menu, or from the Alerting section for a rule that is not tied to a panel. Define the query, the condition, and the evaluation interval. A common pattern is to evaluate every minute and require the condition to hold for five minutes before firing. That pending period, called "for" in Prometheus-style rules, filters out brief spikes that resolve themselves. Without it, every deploy that briefly restarts a pod generates a page, and the team learns to ignore alerts. An alert that fires too often is worse than no alert at all, because it trains people to ignore the one that matters.
Every alert needs a runbook link and a clear summary. The alert message should say what is wrong, which service is affected, and where to look next. A message that says "High error rate" sends the responder hunting. A message that says "Checkout API error rate above 5 percent for 5 minutes, dashboard linked, runbook linked" sends them straight to the problem. Write alert messages as if the reader has just been woken up, because sometimes they have.
Once dashboards and alerts are working, store them as code. Export a dashboard from its settings menu as JSON, save it into your repository, and provision it with Grafana's file provisioning by placing the JSON in the provisioning directory and pointing Grafana at it. From then on, dashboards are deployed like any other configuration: reviewed, versioned and reproducible. Changes go through a pull request, which means someone else looks at the query before it reaches production. That review step catches more bad PromQL than any amount of careful clicking.
The same approach applies to alert rules, which can be provisioned from files or managed through the Grafana API and Terraform. The Grafana Terraform provider can manage dashboards, data sources and alert rules, which fits naturally if your infrastructure already lives in Terraform. Whichever tool you choose, the principle is the same: if a dashboard only exists in a browser, it is not really part of your infrastructure. Put it in version control.
Common Mistakes and How to Fix Them
The most common dashboard mistake is too many panels. A dashboard with forty panels is not comprehensive; it is unusable. Each panel costs attention, and attention is the scarcest resource during an incident. If a dashboard has more than about twelve panels, split it. Keep the overview dashboard small and link to detailed dashboards for the deep dives. Grafana's dashboard links and data links make this easy: a panel can link to a more detailed dashboard with the same variables carried over.
The second mistake is queries that are too expensive. A query that scans a huge amount of data over a long time range will load slowly and strain Prometheus. The fix is usually to record the expensive computation as a recording rule in Prometheus, so Grafana queries a precomputed series instead of raw data. If a panel takes more than a few seconds to load, look at the query first. Shorten the range, add label filters to narrow the series, or move the aggregation into a recording rule.
The third mistake is stale dashboards. A dashboard built for a service that has since changed its metrics, renamed its labels or been replaced entirely will show empty panels and erode trust. Assign an owner to every dashboard and review them regularly. A simple quarterly check works: open each dashboard, confirm every panel has data, and delete the ones nobody can explain. Deleting a dashboard feels wasteful, but a dashboard nobody trusts is already waste.
The fourth mistake is ignoring time zones and time ranges. Grafana defaults to the browser's local time zone, which means two engineers in different countries see different clock times for the same incident. For shared incident work, set the dashboard time zone explicitly to UTC and say so in the dashboard description. It removes one small source of confusion at a moment when confusion is expensive.
Finally, watch out for panels that look healthy because they show no data. A graph with no line can mean the service is fine, or it can mean the query is broken, the label changed, or the exporter stopped. Use the "no data" alert state deliberately: configure alerts so that missing data is treated as a problem, not as silence. A dashboard that fails loudly is far safer than one that fails silently.
Frequently Asked Questions
What is the difference between Grafana and Prometheus?
Prometheus collects and stores time series metrics by scraping targets, and it has its own query language, PromQL. Grafana visualises data from Prometheus and many other sources, and adds dashboards, alerting and user management. You need Prometheus, or another data source, to have data; you need Grafana to make that data readable. Most teams run both together.
Is Grafana free to use?
Yes. Grafana open source is free under the AGPL licence and covers dashboards, data sources and alerting. Grafana Labs also sells Grafana Cloud, a hosted service, and Grafana Enterprise, which adds features such as advanced authentication, reporting and extra data source permissions. For learning and for most small teams, the open source version is more than enough.
How do I share a dashboard with my team?
The simplest way is to give teammates access to the same Grafana instance with viewer or editor roles. You can also share a link to a specific dashboard and time range, export the dashboard as JSON for another instance, or use a snapshot, which shares a static copy of the data without giving access to your data source. Avoid sharing snapshots of sensitive data publicly.
Why is my panel showing no data?
The usual causes are a wrong data source, a query that matches no series, a label value that does not exist, or a time range with no data. Check the query in the Prometheus interface first, where you can see the raw results. If it works there but not in Grafana, check the data source settings and the time range. If it works nowhere, the metric name or labels have probably changed.
Should I use Grafana Cloud or self-host Grafana?
Self-hosting is free and gives you full control, and it is the best choice for learning. Grafana Cloud removes the work of running, upgrading and scaling Grafana and its data sources, which is worth paying for once monitoring becomes business-critical and the team would rather spend time on dashboards than on operating the monitoring stack. Start self-hosted, move to Cloud when the operational cost outweighs the subscription.
Conclusion
A good Grafana dashboard is a tool for making decisions under pressure. Build it around the four golden signals, keep the top row focused on health, use variables so one dashboard serves every environment, alert on symptoms rather than causes, and store the result as code so it survives the next rebuild. The dashboard you built in this tutorial is a starting point, not a finished product. The next step is to point it at a real service, watch it for a week, and remove every panel that never helped you make a decision. What remains will be a dashboard your team actually trusts, and that is the real goal. If you want to go further, read our site reliability engineer career guide to see how dashboards and alerting fit into the wider SRE role.
Sources: Verified 2 Dec 2026. Grafana dashboard documentation: https://grafana.com/docs/grafana/latest/dashboards/ ; Prometheus data source documentation: https://grafana.com/docs/grafana/latest/datasources/prometheus/ . Grafana 13.3.2 confirmed as latest stable (released 24 Nov 2026). No unverified figures stated.
