Monitoring with Grafana & Prometheus

In this tutorial, we are going to create a grafana dashboard for our stake pool that have 3 nodes relays and 1 core node (block producer).

One of the relay nodes, the relay3, will be used as grafana host, it will be the server where installing and deploying grafana monitoring web. So for this server, the configuration steps will be a bit different, and the rest relays and core nodes will follow the same steps.

We will monitor both the cardano-node generated metrics and the general server metrics of the Prometheus node-exporter service.

Setup environment

Install Grafana

Add key to apt :

Add repository to apt:

Update the packages (now we have grafana repo and verifiable with the key):

Install grafana:

Change port where grafana web will be deployed:

Choose the port of your choice(you can use the default port):

http_port = <port>

Start grafana service and enable to start on reboot:

Check grafana status:

Others options:

Open the port used in grafana.ini with ufw:

circle-info

Now, everyone can access to the login grafana page throw a browser:http://<ip-address>:<port>

1est time, use 'admin' as user & password, then, change the password.

You can give a domain to the ip-address to give it a more friendly access.

Finally, install the Clock plugin:

Install Prometheus & node exporter

Choose the port fo your choice, change the line from:

To:

Start the services and enable them to init when reboot:

Once all the services are installed and working, lets edit the prometheus conf file to add the relays and core metrics data source:

Add metrics data sources to Prometheus: relays & core

Before continue, be sure to complete all relays and core steps.

Delete all content and add the new conf:

Note that, the relay3 is the host of grafana monitoring tool, so we just need to specify the localhost ip 127.0.0.1 for this source, because they are in the same machine.

circle-info

Be sure to replace <ip-address> and <node-exporter-port> with your own values.

Restart the service to load the new conf:

Grafana monitor web

Add Prometheus source:

In grafana left menu, go to Configuration > Data Sources > Add data source and select Prometheus.

Create a new stake pool dashboard from scratch:

In grafana left menu, go to + > Create > Dashboard.

Create a graph about connected peers:

1. Select Prometheus data source

2. Select a specific metric

Create a chart about connected peers:

Example output:

3. Set chart properties

Load a dashboard from file.

In grafana panel, Go to + > Create > Import > enter json content.

Example panel version 1:

circle-check

Última actualización