There is a Grafana dashboard setup that works with any Cosmos SDK / CometBFT chain.
Let's set it up for our network.
Prerequisites
First install Grafana and Prometheus on your machine.
Enable CometBFT metrics
You will need to edit the node's config/config.toml file, setting prometheus to true:
sed -i 's/prometheus = false/prometheus = true/g' \
<YOUR-NODE-HOMEDIR>/config/config.tomlIn order for the change to take effect you will need to restart the node. You should be able to access the CometBFT metrics on port 26660: http://localhost:26660
Configure prometheus targets
Find prometheus.yml file and append the following job under the scrape_configs:
On linux machines this file can be found under this path: /etc/prometheus/prometheus.yml
- job_name: terp
static_configs:
- targets: ['localhost:26660']
labels:
instance: validatorResolving port conflicts
When both terpd and prometheus are running on the same machine, one of the service will encounter a port conflict, causing it to be unable to execute. Do the following to resolve this issue.
Open the node's config/app.toml file and look for:
[grpc]
address = "0.0.0.0:9090"Change the port to something else:
[grpc]
address = "0.0.0.0:9095"Restart prometheus and terpd
Restart terpd using the followng:
sudo systemctl stop terpd
sudo systemctl start terpdThe you can restart prometheus:
sudo service prometheus restartAdding a prometheus service file (Optional)
A service file can be used to allow for the automatic restart of the service, helping to make sure that your node is always monitored.
You can create a service file with:
nano /etc/systemd/system/prometheus_s.serviceAdd the following content to the file:
[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target
[Service]
User=$USER
Type=simple
ExecStart=/home/$USER/prometheus/prometheus \
--config.file /home/$USER/prometheus/prometheus.yml \
--storage.tsdb.path /home/$USER/prometheus/ \
--web.console.templates=/home/$USER/prometheus/consoles \
--web.console.libraries=/home/$USER/prometheus/console_libraries
Restart=always
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.targetYou can then reload the systemctl daemon:
sudo systemctl daemon-reloadAdditional Node Monitoring Tooling s
- PANIC - https://github.com/SimplyStaking/panic
- cvms - https://github.com/cosmostation/cvms
- polkachu server monitoring - https://github.com/polkachu/server-monitoring
- tenderduty - https://github.com/cosmostation/tenderduty