Setup Prometheus and Grafana Dashboard

Hello Community,

I am wondering how I can add my second relay to connect to relay #1 this way I can also see the data on the grafana dashboard.

I am following this guide, Guide: How to build a Cardano Stake Pool - CoinCashew but it only covers one relay and one bp. how would I need to modify it for relay #2 to connect to relay #1 to export the data?

Inside prometheus.yml file clone the producer config but adapt for the relay

and as far as installation, just need to install as if it was for a block producer?

Exactly, same ports, as the producer (if the grafana is installed on 1st relay)

I am getting this error when I check the statusā€¦

Share here the prometheus fileā€¦
replace/cover the IPs of the nodes first

How should the prometheus config file shoud look?

this is the original without the IPs

  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).
  external_labels:
    monitor: 'codelab-monitor'

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label job=<job_name> to any timeseries scraped from this config.
  - job_name: 'prometheus'

    static_configs:
      - targets: ['localhost:9100']
      - targets: ['<block producer public ip address>:9100']
      - targets: ['<block producer public ip address>:12798']
        labels:
          alias: 'block-producer-node'
          type:  'cardano-node'
      - targets: ['localhost:12798']
        labels:
          alias: 'relaynode1'
          type:  'cardano-node'

this is how I modified it after when I started getting the error

  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).
  external_labels:
    monitor: 'codelab-monitor'

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label job=<job_name> to any timeseries scraped from this config.
  - job_name: 'prometheus'

    static_configs:
      - targets: ['localhost:9100']
      - targets: ['<block producer public ip address>:9100']
      - targets: ['<block producer public ip address>:12798']
        labels:
          alias: 'block-producer-node'
          type:  'cardano-node'
      - targets: ['localhost:9100']
      - targets: ['<relay2 public ip address>:9100']
      - targets: ['<relay2 public ip address>:12798']
        labels:
          alias: 'relaynode2'
          type:  'cardano-node'
      - targets: ['localhost:12798']
        labels:
          alias: 'relaynode1'
          type:  'cardano-node'

It looks fine, check for other characters maybe a space, etc
Then restart the process

Thank you @Alexd1985, I went ahead and did it again and it is running without throwing the errors.

I wanted to know if you are able to help me adapt this dashboard to my config. I tried doing it but it is not connecting correctly.

I went ahead and corrected the ā€˜aliasā€™ for the nodes, but it was not able to connect.

Then I was not sure what ports I should use on each config here.

this is the error i am getting
image

But the rest of the grafs are working?

using this json I pointed out, none of the graphs work.

Try my dashboard

https://charity-pool.ro/files/CHRTY_dashboard.txt

just replace to legend (inside grafana metrics) instance with alias

This is what I get with yours

Ok, so for the new relay u donā€™t see infos

On new relay:

  • check inside configuration file, u should have
    ā€œhasPrometheusā€: [
    ā€œ0.0.0.0ā€,
    12798
    If u have 127.0.0.1 replace with 0.0.0.0 save the file and restart the node

  • check if u opened the ports in firewall

  • check the node_exporter services

@Alexd1985 I was able to get the grafana to connect to the server, but for some reason, I see like 3 things for each serverā€¦ and all the numbers seem to be off as well.

Nevermind, I was able to fix the issue by uninstalling prometheus and installing it again.
Thank you for your help :slight_smile:

1 Like

Youā€™re getting this error because you donā€™t have the clock-panel plugin for Grafana. You need to add that to Grafana separately.

See this page:

https://grafana.com/grafana/plugins/grafana-clock-panel/

Yes thank you @nimrod i will create and account and download it.

By any chance are you able to assist on this post? I was able to make most of your dashboard to work but havenā€™t gotten adapools

@rodrigo already posted the link to the solution for this, on the original thread about these Grafana dashboards:

Yes I tried that but did not get the adapool_ parameters to show up on grafana