Prometheus & Grafana
Prerequisites
Golang
Make sure you have Golang installed. For instructions on how to install here click here. To make sure it is installed run correctly:
go versionOutput example:
go version go1.16.3 linux/amd64Check Metrics
Make sure metrics are being exposed. For this check you can run:
curl localhost:9900/metrics | grep ^hmyOutput example:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6087 0 6087 0 0 849k 0 --:--:-- --:--:-- -hmy_consensus_blskeys{index="0",pubkey="892f005b61d2c4f482a87a1da7226c210dbb6175b52ba391a941bcdab577f90767d0bbb5282f0d073b73eeb706c14810"} 0
-:--hmy_consensus_finality_bucket{le="800"} 1959
:-hmy_consensus_finality_bucket{le="1000"} 1960
- hmy_consensus_finality_bucket{le="1250"} 1960
8hmy_consensus_finality_bucket{le="1562.5"} 1960
49hmy_consensus_finality_bucket{le="1953.125"} 1960
khmy_consensus_finality_bucket{le="2441.40625"} 1960 (...continues)Setup Prometheus
Create User
Create Directories
Extract and Install
Download the latest version of Prometheus here.
Configure Targets
Open prometheus.yml configuration file:
Change the default port to 9900 and save the file:
Setup Permissions
Setup Systemd
Create prometheus systemd file:
Add the following to prometheus.service file:
Enable and Start Prometheus
Check Metrics
You can now load Prometheus on your browser: http://Your_IP_Address:9090. You can run up or any other query to see if everthing is working as expected:

Setup Grafana
Install
Follow instructions here on how to download and install Grafana for your OS.
Once started, you should be able to load Grafana on your browser: http://Your_IP_Address:3000. Default user and password is admin.

Add Prometheus Datasource
Go to http://Your_IP_Address:3000/datasourcesand add Prometheu as datasource:

Import Dashboard
Go to http://Your_IP_Address:3000/dashboard/import and load the json file below:

Json file:
Load Dashboard
Once you save it you should see the dashboard loaded on Grafana:

Last updated
Was this helpful?