Setting Up Dashboards
  • Prometheus is a monitoring platform that collects metrics from monitored targets by scraping metrics HTTP endpoints on these targets. Official documentation is available here.
  • Grafana is a dashboard used to visualize the collected data.

Install prometheus and prometheus node exporter.
block producer node
sudo apt-get install -y prometheus prometheus-node-exporter
sudo apt-get install -y prometheus-node-exporter
Install grafana.
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
echo "deb https://packages.grafana.com/oss/deb stable main" > grafana.list
sudo mv grafana.list /etc/apt/sources.list.d/grafana.list
sudo apt-get update && sudo apt-get install -y grafana
Enable services so they start automatically.
block producer node
sudo systemctl enable grafana-server.service
sudo systemctl enable prometheus.service
sudo systemctl enable prometheus-node-exporter.service
sudo systemctl enable prometheus-node-exporter.service
Update prometheus.yml located in /etc/prometheus/prometheus.yml
Change the <block producer ip address> in the following command.
cat > prometheus.yml << EOF
scrape_interval: 15s # By default, scrape targets every 15 seconds.
# Attach these labels to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
monitor: 'codelab-monitor'
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
# The job name is added as a label job=<job_name> to any timeseries scraped from this config.
- job_name: 'prometheus'
- targets: ['localhost:9100']
alias: 'relaynode1'
type: 'cardano-node'
- targets: ['<block producer ip address>:9100']
alias: 'block-producer-node'
type: 'cardano-node'
- targets: ['<block producer ip address>:12798']
alias: 'block-producer-node'
type: 'cardano-node'
- targets: ['localhost:12798']
alias: 'relaynode1'
type: 'cardano-node'
sudo mv prometheus.yml /etc/prometheus/prometheus.yml
Finally, restart the services.
sudo systemctl restart grafana-server.service
sudo systemctl restart prometheus.service
sudo systemctl restart prometheus-node-exporter.service
Verify that the services are running properly:
sudo systemctl status grafana-server.service prometheus.service prometheus-node-exporter.service
Update config.json config files with new hasEKG and hasPrometheus ports.
block producer node
sed -i config.json -e "s/"
sed -i config.json -e "s/"
Port forwarding and firewall config:
On block producer node (or relaynodeN), you need to open ports 12798 and 9100
On relaynode1, you will need to open ports 3000 for grafana.
Stop and restart your stake pool.
block producer node
sudo systemctl restart cardano-node
sudo systemctl restart cardano-node
Verify the metrics are working by querying the prometheus port.
block producer and relaynodes
curl -s
# Example output:
# rts_gc_par_tot_bytes_copied 123
# rts_gc_num_gcs 345
# rts_gc_max_bytes_slop 4711111
# cardano_node_metrics_served_block_count_int 8112
# cardano_node_metrics_Stat_threads_int 8
# cardano_node_metrics_density_real 4.67

  1. 1.
    On relaynode1, open http://localhost:3000 or http://<your relaynode1 ip address>:3000 in your local browser. You may need to open up port 3000 in your router and/or firewall.
  2. 2.
    Login with admin / admin
  3. 3.
    Change password
  4. 4.
    Click the configuration gear icon, then Add data Source
  5. 5.
    Select Prometheus
  6. 6.
    Set Name to "Prometheus"
  7. 7.
    Set URL to http://localhost:9090
  8. 8.
    Click Save & Test
  9. 9.
    Download and save this json file.
  10. 10.
    Click Create + icon > Import
  11. 11.
    Add dashboard by Upload JSON file
  12. 12.
    Click the Import button.
Credits to KAZE stake pool for this dashboard
Community contributer SNSKY is sharing a very detailed Grafana tutorial
Congratulations. You're basically done. More great operational and maintenance tips in section 18.
Be sure to review the Stake Pool Operator's Best Practices Checklist to ensure smooth sailing with your pool.
Copy link
Edit on GitHub
On this page
Installing Prometheus and Grafana
Configuring Grafana