Setup

  1. Install grafana using Script

#!/bin/bash
echo 'deb https://packages.grafana.com/oss/deb stable main' >> /etc/apt/sources.list
curl https://packages.grafana.com/gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install grafana

systemctl daemon-reload
systemctl start grafana-server
systemctl enable grafana-server.service
chmod +x grafana.sh
sudo ./grafana.sh

Setting up Grafana For Prometheus

Install Grafana on instance which queries our Prometheus server.

wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.0.4_amd64.deb
sudo apt-get install -y adduser libfontconfig
sudo dpkg -i grafana_5.0.4_amd64.deb

Then, Enable the automatic start of Grafana by systemd:

sudo systemctl daemon-reload && sudo systemctl enable grafana-server && sudo systemctl start grafana-server.service

Grafana is running now, and we can connect to it at http://your.server.ip:3000. The default user and password is admin / admin.

Now you have to create a Prometheus data source:

  1. Click on the Grafana logo to open the sidebar.

  2. Click on “Data Sources” in the sidebar.

  3. Choose “Add New”.

  4. Select “Prometheus” as the data source.

  5. Set the Prometheus server URL (in our case: http://localhost:9090/).

  6. Click “Add” to test the connection and to save the new data source.

Settings should look like this:

Create your first dashboard from the information collected by Prometheus. You can also import some dashboards from a collection of shared dashboards

Dashboard

Last updated