[Cosmos] Monitoring Dashboard with Prometheus

Jay | Cypher Core
Dec 20, 2018 · 4 min read
  1. Before you start, make sure prometheus is set to true in .gaiad/config/config.toml.
  2. Run this script for automatic installation if you are feeling lazy.

1 — Install Grafana

  • Navigate to your working directory of choice
  • Visit here and grab the download link for the architecture and OS that run on your device

For demonstration purposes, this tutorial will assume an amd64-based device running Linux is used.

2 — Start Grafana Server As a Service

Choose either one of the approaches down below:

Option 1: via systemd

Optionally, you may make grafana-server start at boot

Option 2: init.d service

Optionally, you may make grafana-server start at boot

3 — Download Prometheus

  • Navigate to your working directory of choice
  • Visit here and grab the download link for the architecture and OS that run on your device
  • Extract the tar.gz file
  • cd into the folder containing the extracted files

4 — Configure Prometheus

  • Add the following in prometheus.yaml using your editor of choice

Feel free to change job_name and group to whatever you like. You can verify if your finished prometheus.yaml is valid using YAMLLint.

5 — Start Prometheus

While still in the folder where the extracted files are located, run

Prometheus is now running. We will then need to configure a dashboard on Grafana.

6 — Add a Data Source

  • Log in on Grafana.com with your registered account (register if you haven’t) by hitting the Log In button on the top right corner
Fig. 1
  • Once logged in, go to your Org Profile page and create a Grafana instance
Fig. 2
Fig. 3
  • Log in to the instance you just created, and start adding a data source by clicking on the gear button at the bottom of the column on the left. Then click on Add data source
Fig. 4

On the settings page make sure your settings match, or are at least close to what’s shown below:

Fig. 5
  • Hit “Save & Test” to finish adding the data source

7 — Build a Dashboard

You are welcome to make your own dashboard. For your convenience, we have one ready for you in this tutorial. Simply follow the steps below to import it:

  • Start importing by clicking on the + button at the top of the column on the left. Paste in the JSON from here and load it
Fig. 6
  • Go to the Dashboards page by hitting the button below the + button. And Voilà ! You now have a working dashboard
Fig. 7

Bonus — Node Exporter

Download the latest Prometheus Node Exporter static binary from here, and extract it:

Change working directory to where you extracted the binary to, then run the node exporter:

Add the following in prometheus.yaml using your editor of choice.

Resources

[1] Katernoir. (2018, August 30). Monitoring/Alerting for your Validator. Retrieved December 20, 2018, from https://forum.cosmos.network/t/monitoring-alerting-for-your-validator/446/28

[2] Grafana. (n.d.). Installing on Debian / Ubuntu. Retrieved from http://docs.grafana.org/installation/debian/

[3] Prometheus. (n.d.). First steps with Prometheus. Retrieved December 20, 2018, from https://prometheus.io/docs/introduction/first_steps/

Cypher Core

Deliver blockchain solutions to end users and employees.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store