0
votes

So i set up grafana and prometheus to monitor my servers but i don't get any data in grafana (and i don't know how i can check if its working outside of grafana... Grafana view no data

Prometheus.yml:

global:
  scrape_interval: 10s

scrape_configs:
  - job_name: 'prometheus'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9090']
  - job_name: 'node'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9100', '192.168.1.11:9100', '192.168.1.12:9100']

What did i miss/do wrong?

Edit: I do have node_exporter running on all my servers i want to check out. Prometheus seems to gets its data? Prometheus graph

1
You need to check that prometheus is scraping data correctly. Look at hostname:9090/graph for the prometheus query interface. Chances are that the problem is that prometheus is not scraping, and so Grafana will find nothing. If there IS data in Prometheus but not Grafana, then that's a different problem.Andy Lester
First of all: have you installed the Node Exporter on the servers?Marcelo Ávila de Oliveira
Thanks for the quick reply's yes i got node exporter on all my servers, and it seems prometheus is scraping data (see edit) (on one server i intentionaly did not install node exporter yet as the others are test servers for now)Meerweten

1 Answers

1
votes

Prometheus is sending data so the issue seems to be on the Grafana end.

Go to Explore in Grafana and run the same query as run on Prometheus in the screenshot above.

If you dont get the response,the DataSource is not configured properly.Go to Configuration->DataSource and check the Prometheus as the source.Save and Test would show a notification saying if Grafana was able to connect to the datasource.

If you get the response then the Dashboard seems to the problem.Check one or more of the queries in the panels in graph and check whether those metrics are available in Prometheus

Next check the variables in the dashboard to check if they are correct.