Add a Prometheus Dashboard to Grafana: Import & Fix
In this article
This guide walks you through adding a Prometheus data source to Grafana, importing a pre-built dashboard from Grafana.com, and troubleshooting common issues like blank panels or missing metrics. You'll learn the exact clicks, fields to fill, and what to check when things don't work.
What You'll Need
- A running Grafana instance (version 9.x or newer recommended).
- A running Prometheus server that is scraping metrics from your targets.
- The URL of your Prometheus server (e.g.,
http://localhost:9090). - Access to Grafana with admin or editor permissions.
- An internet connection to fetch dashboards from Grafana.com (or a downloaded JSON file).
Step-by-Step
- Add Prometheus as a data source
- Log in to Grafana and click the Connections icon (link/plug) in the left sidebar, then select Data sources.
- Click Add data source and choose Prometheus.
- In the URL field, enter your Prometheus server address (e.g.,
http://localhost:9090). If Prometheus is on a remote host, use its IP or hostname. - Leave Access as Server (default) unless you have a specific reason to change it.
- Click Save & Test. You should see a green success message: “Data source is working.” If not, see the Troubleshooting section below.
- Find a dashboard to import
- Go to grafana.com/grafana/dashboards in your browser.
- Search for a dashboard that matches your use case. For example, “Node Exporter Full” (ID 1860) for Linux hosts, or “Prometheus 2.0 Overview” (ID 3662) for Prometheus itself.
- Open the dashboard page and copy the dashboard ID (a number) or download the JSON file.
- Import the dashboard
- Back in Grafana, hover over the Dashboards icon (four squares) in the left sidebar and click Import.
- In the Import via grafana.com field, paste the dashboard ID and click Load. Alternatively, click Upload dashboard JSON file and select your downloaded file.
- On the next screen, choose a name and folder for the dashboard (optional).
- In the Prometheus dropdown, select the data source you added in Step 1.
- Click Import. You'll be taken to the new dashboard.
- Verify the dashboard works
- Look at the top-right time picker. Set a time range that has data (e.g., “Last 15 minutes”).
- Check the panels. If they show graphs or numbers, everything is working.
- If panels show “No data” or errors, proceed to the Troubleshooting section.
Common Mistakes
- Wrong data source selected – Forgetting to pick your Prometheus data source during import results in panels querying the default (often “Grafana”) data source, which has no metrics.
- Incorrect Prometheus URL – Using
http://localhost:9090when Grafana runs on a different machine means Grafana can't reach Prometheus. Use the host's IP or hostname. - Firewall or network issues – Prometheus may be running but not accessible from Grafana due to firewall rules or Docker network isolation.
- Dashboard requires a different Prometheus version – Some dashboards use newer PromQL functions that older Prometheus versions don't support, causing errors.
- Time range too narrow – If you set a time range that predates your data, panels will appear empty.
Tips
- When importing, always double-check the data source dropdown – it's easy to leave it on the default.
- Use the Explore view (compass icon) to test PromQL queries directly against your data source before debugging a dashboard.
- If a dashboard has many panels, start by checking a single panel's query in Edit mode to isolate issues.
- Bookmark your Prometheus data source settings page – you'll need it for troubleshooting.
- For production, consider using a provisioning file (YAML) to manage data sources and dashboards as code, but manual import is fine for testing.
Troubleshooting
- “Data source is working” fails
- Check that Prometheus is actually running. Try opening its URL in a browser – you should see the Prometheus UI.
- If Grafana runs in Docker, use
http://host.docker.internal:9090on Windows/Mac, or the host's IP on Linux. - Check firewall rules – allow traffic on port 9090 from the Grafana host.
- Panels show “No data”
- Click the panel title → Edit. Look at the query. Is it using the correct data source? Does the metric name exist? Test the query in Explore.
- Check the time range – extend it to “Last 24 hours” to see if data appears.
- Verify that Prometheus is actually scraping the target. In Prometheus UI, go to Status → Targets – all should be UP.
- Panels show errors like “parse error”
- The dashboard may use PromQL syntax that your Prometheus version doesn't support. Check your Prometheus version and compare with the dashboard's requirements (often listed on its Grafana.com page).
- Try updating Prometheus to a newer version, or find a dashboard that matches your version.
- Some panels work, others don't
- This usually means the broken panels reference metrics that aren't being scraped. Check the dashboard's documentation for required exporters (e.g., node_exporter, cAdvisor).
- Install the required exporter and add it to Prometheus's scrape config.
- Dashboard imports but looks empty
- Sometimes the dashboard uses variables (e.g.,
$instance) that default to a value with no data. Go to dashboard Settings → Variables and adjust the default or hide the variable.
- Sometimes the dashboard uses variables (e.g.,
Frequently Asked Questions
- Can I use a dashboard without a data source? No, every panel in a dashboard needs a data source to query. You must add Prometheus first.
- Do I need to import the JSON file or the ID? Both work. The ID is easier if you have internet access; the JSON file is useful for offline or version-controlled setups.
- Why does the dashboard show data from the wrong source? This happens when you select the wrong data source during import. Edit the panel and change the data source in the query editor.
- Can I edit an imported dashboard? Yes, you can edit any panel. Changes are saved to your Grafana instance; they don't affect the original on Grafana.com.
- How do I update an imported dashboard? Re-import the same dashboard ID – Grafana will ask if you want to overwrite the existing one. Be aware that custom changes will be lost.
- What if I don't see the Import option? You need Editor or Admin role. If you're a Viewer, you can only view dashboards, not import them.