Prometheus Monitoring (Non-Cluster)
Introduction
In this guide we will cover how to monitor your Node and Farmer with Prometheus and Grafana
Prerequisites
Prior to using this guide you should have Prometheus set up as a service:
You should also have Grafana running via one of the following methods
Expose Metrics
If following my guides, the Node and Farmer are already set to expose metrics. If not following my guides metrics can be enabled by adding the --prometheus-listen-on
flag.
Node
--prometheus-listen-on 127.0.0.1:9080
Farmer
--prometheus-listen-on 127.0.0.1:9081
Restart your Node & Farmer after making the above changes.
Update Config
The Prometheus config file must be updated to include the endpoints for the Farmer and Node metrics. Open up the config
sudo nano /etc/prometheus/prometheus.yml
Go to the bottom and add the following job
- job_name: 'autonomys'
static_configs:
- targets: ['localhost:9080']
labels:
instance: 'comet-alpha'
type: 'node'
- targets: ['localhost:9081']
labels:
instance: 'comet-alpha'
type: 'farmer'
Then restart Prometheus
sudo systemctl restart prometheus
Metrics are now being ingested by Prometheus and can be exposed in Grafana.
Grafana
Import Dashboard
In Grafana the Autonomys dashboard can now be imported. Select the "Dashboard" menu item. Then "New", and then "Import". For the "dashboard URL or ID" enter "20443". Then click load.
The dashboard is a bit old, but it is currently the best option. Update the name to something like "Autonomys Dashboard". Then add something to the uid to make it unique. Finally, select the Prometheus data source previously set up and click "Import".