Kubernetes ingress nginx grafana dashboard prometheus data was empty

2/15/2019

I just completely setup prometheus and grafana dashboard using this tutorial https://kubernetes.github.io/ingress-nginx/user-guide/monitoring/.

I try to query something in prometheus and it was successfully plotting the graph. But when I access my Grafana dashboard with connecting to prometheus data, it returns empty charts like the below pic.

Grafana Result

Do I miss something in the step?

-- Justinus Hermawan
grafana
kubernetes
nginx-ingress
prometheus

1 Answer

2/21/2019

Probably, you didn't create datasource in Grafana before the dashboard import. It is not specified in the manual, but dashboard will not work correctly without it.

How to create Data Source in Grafana:

  1. Open Configuration(gear) -> Data Sources
  2. Press "Add data source"
  3. Select Prometheus
  4. Specify Prometheus server URL: (e.g: http://10.22.0.3:32150/)
  5. Press "Save & Test"
  6. See the confirmation about passed test.

Now, select existing Data Source from the drop-down list during the import of the Nginx Ingress Dashboard from JSON. URL to the dashboard didn't work for me, so I've just copypasted the whole JSON content except two first lines with comments.

For existing dashboard you can change the data source:

  1. Open Dashboards -> Manage
  2. Click on "Nginx Ingress Controller"
  3. Open its settings (gear picture on the top)
  4. Select "JSON Model"
  5. Update all lines with "datasource": "old_data_source_name", to the desired name
  6. Press "Save changes"
  7. Press green "Save" button on the left, under "Settings"

Alternatively, you can edit every element on the dashboard and select the desired data source from the drop-down list. Not very convenient way, so I'd prefer to import dashboard again.

-- VAS
Source: StackOverflow