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:

  1. Data source misconfigured — Grafana can’t connect to Prometheus/InfluxDB
  2. Prometheus not scraping — Prometheus isn’t collecting data from targets
  3. Time range mismatch — the dashboard time range doesn’t contain data
  4. Query syntax error — the PromQL or other query language has an issue
  5. 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:

  1. Go to Configuration → Data Sources in Grafana
  2. Click on your Prometheus data source
  3. 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:

  1. Open Prometheus at http://your-server:9090
  2. Go to Status → Targets
  3. 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:

  1. In the top-right corner, change the time range to “Last 5 minutes”
  2. If data appears, the issue was just the time range
  3. 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:

  1. In Prometheus UI (http://your-server:9090/graph), paste the query from your Grafana panel
  2. 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:

  1. Verify the logged-in user has permission to view the data source
  2. Check Configuration → Data Sources → Permissions
  3. 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

Comments