<p>I just completely setup prometheus and grafana dashboard using this tutorial <a href="https://kubernetes.github.io/ingress-nginx/user-guide/monitoring/" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/user-guide/monitoring/</a>.</p>

<p>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.</p>

<p><a href="https://i.stack.imgur.com/WpQvU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WpQvU.png" alt="Grafana Result"></a></p>

<p>Do I miss something in the step?</p>

Justinus Hermawan
<p>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.</p>

<p>How to create Data Source in Grafana:</p>

<ol>
<li>Open Configuration(gear) -> Data Sources</li>
<li>Press "Add data source"</li>
<li>Select Prometheus</li>
<li>Specify Prometheus server URL: (e.g: <a href="http://10.22.0.3:32150/" rel="nofollow noreferrer">http://10.22.0.3:32150/</a>)</li>
<li>Press "Save &amp; Test"</li>
<li>See the confirmation about passed test.</li>
</ol>

<p>Now, select existing Data Source from the drop-down list during the import of the Nginx Ingress Dashboard from <a href="https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/grafana/dashboards/nginx.json" rel="nofollow noreferrer">JSON</a>. URL to the dashboard didn't work for me, so I've just copypasted the whole JSON content except two first lines with comments.</p>

<p>For existing dashboard you can change the data source:</p>

<ol>
<li>Open Dashboards -> Manage</li>
<li>Click on "Nginx Ingress Controller"</li>
<li>Open its settings (gear picture on the top)</li>
<li>Select "JSON Model"</li>
<li>Update all lines with "datasource": "old_data_source_name", to the desired name</li>
<li>Press "Save changes"</li>
<li>Press green "Save" button on the left, under "Settings"</li>
</ol>

<p>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. </p>
