Grafana and Prometheus connection - the-code-camp/hpe-sre GitHub Wiki
Overview
You should already have Grafana running at http://localhost:3000/
In this lab we will see how to connect Grafana for dashboarding to Prometheus using what's known as a data source.
Add a data source
To query and visualize data from a Prometheus-compatible backend in a Grafana dashboard, we will first need to configure a Prometheus data source in Grafana.
To do this, click on "Add your first data source" on the main Grafana page:
From the list of possible data source types, choose "Prometheus" (note that you can connect many data sources to Grafana as it's really the dashboarding/view layer):
In the resulting settings dialog, set the "Name" field to "HPE Demo Prometheus" and the URL field to http://prometheus:9090 . This points the data source at the public PromLabs demo Prometheus server that contains some data we can work with.
You can keep all other fields with their default values
Take a minute to explore the other options (cookies, authentication, TLS, headers, etc.) that you can set for a data source. In this case, it's fine to keep them all at their default values.
Press "Save & test":
You should see a confirmation message stating that the data source is working:
Congrats! Now we are ready to build our first dashboard using the Prometheus data source.