Grafana Dashboard Not Loading Data — Fix
The Problem
Grafana dashboards show “No data” in panels, display empty charts, or show the message “No data points.” This can happen with new installations, after upgrades, or when data sources change.
The Cause
There are several common causes, each with a different fix:
- Data source misconfigured — Grafana can’t connect to Prometheus/InfluxDB
- Prometheus not scraping — Prometheus isn’t collecting data from targets
- Time range mismatch — the dashboard time range doesn’t contain data
- Query syntax error — the PromQL or other query language has an issue
- Permission issue — Grafana doesn’t have access to the data source
The Fix
Method 1: Verify Data Source Connection
This is the most common cause. Check that Grafana can reach Prometheus:
- Go to Configuration → Data Sources in Grafana
- Click on your Prometheus data source
- Click “Save & Test”
If it shows “Data source is working,” the connection is fine — skip to Method 2.
If it fails, fix the URL. Common mistakes:
# Wrong — 'localhost' refers to the Grafana container, not the host
http://localhost:9090
# Right — use the Docker service name
http://prometheus:9090
If Grafana and Prometheus are in different Docker networks:
# docker-compose.yml — both services must share a network
services:
grafana:
networks:
- monitoring
prometheus:
networks:
- monitoring
networks:
monitoring:
Method 2: Check Prometheus Targets
Prometheus may be running but not scraping any targets:
- Open Prometheus at
http://your-server:9090 - Go to Status → Targets
- Check that targets show “UP” in green
If targets show “DOWN”:
# prometheus.yml — verify the target address
scrape_configs:
- job_name: 'node'
static_configs:
# Wrong — if node_exporter is in Docker
- targets: ['localhost:9100']
# Right — use the service name
- targets: ['node-exporter:9100']
If no targets appear, verify prometheus.yml is mounted correctly:
docker exec prometheus cat /etc/prometheus/prometheus.yml
Method 3: Fix Time Range
Grafana may be showing a time range with no data:
- In the top-right corner, change the time range to “Last 5 minutes”
- If data appears, the issue was just the time range
- Check if your server’s clock is correct:
# On the host
date -u
# If the clock is wrong, sync it
sudo timedatectl set-ntp true
Time zone mismatches between Grafana, Prometheus, and the host cause data to appear at unexpected times.
Method 4: Test the Query
Check if the PromQL query itself returns data:
- In Prometheus UI (
http://your-server:9090/graph), paste the query from your Grafana panel - Click “Execute”
If Prometheus returns data but Grafana doesn’t, the issue is in how Grafana sends the query. Common fixes:
# If using a variable like $instance that doesn't resolve
# Check: Dashboard Settings → Variables → Preview of values
# If the metric name changed after a Prometheus upgrade
# Old: node_cpu
# New: node_cpu_seconds_total
Method 5: Check Permissions
If using Grafana with authentication and roles:
- Verify the logged-in user has permission to view the data source
- Check Configuration → Data Sources → Permissions
- Ensure the data source isn’t restricted to specific teams or roles
For API-based dashboards, verify the API key has Viewer or Editor role:
curl -H "Authorization: Bearer YOUR_API_KEY" \
http://grafana:3000/api/datasources
Prevention
- Pin Prometheus and Grafana versions in Docker Compose — version mismatches cause query compatibility issues
- Test data source connections after any Docker network changes
- Use Docker service names (not
localhost) for inter-container communication - Set up a health check dashboard that monitors Prometheus scrape success rate
- Configure NTP on the host to prevent time drift
Related
Get self-hosting tips in your inbox
Get the Docker Compose configs, hardware picks, and setup shortcuts we don't put in articles. Weekly. No spam.
Comments