Grafana Dashboard for Peer Analysis

Hello everyone, I’m a newbie to pool operations. My setup is based on IOHK-released docker images. I’m using a useful Grafana dashboard to monitor my nodes.

In the early days, I also tested cardano-community docker images which has built-in tools. As you know, one of the tools I loved is peer analysis of gLiveView. I would like to make an equivalent of this pane with Grafana. I did some research and I couldn’t find how this analysis is made. Is there any ready-to-use dashboard or any information about peer analysis procedure?

Thanks in advance.

Hi,

I have it but only for OUT peers connected

image

cardano.node.metrics.connectedPeers

But I guess u don’t want only the counters…

Cheers,

Hi Alex, the dashboard I used also has something like that. However, I would like to add a new dashboard or new pane to the existing dashboard so that I can view connection- or peer-wise details. For example, in my topology file, 20 connection + 1 core connection is listed, but 3 of them is unreachable or unavailable at the time of writing. I want to know which one is disconnected, or how many IN connection is established to my relay.

image

Hi,

Not sure if you can get every details from gLiveView to grafana, but I personally use this dashboard, with minor modifications

https://raw.githubusercontent.com/coincashew/coincashew/master/.gitbook/assets/grafana-monitor-cardano-nodes-by-kaze.json

Hi, thanks for sharing. I also have almost the same metrics. I especially focused on IN connection peers. I think I found something. A valuable SP, PANL, shares some tutorials about operating and monitoring nodes. They made some text data extractors, and one of them is IN connection.

I will focus on it :slight_smile:

3 Likes

Hi @Bilge_Mirac_Atici

If I wanted to build that, I would write my own script(s) using the following approach:

  1. RETRIEVING A LIST OF PEERS

As a starting point, in the gLiveView.sh script the CheckPeers() method includes the following lines to retrieve a list of peers:

peers_in=$(ss -tnp state established 2>/dev/null | grep "${CNODE_PID}," | awk -v port=":${CNODE_PORT}" '$3 ~ port {print $4}')

peers_out=$(ss -tnp state established 2>/dev/null | grep "${CNODE_PID}," | awk -v port=":(${CNODE_PORT}|${EKG_PORT}|${PROM_PORT})" '$3 !~ port {print $4}')

  1. PINGING PEERS

cncli ping command usage is described at cncli/USAGE.md at develop · cardano-community/cncli · GitHub

Also, the latencyCNCLI () method in the gLiveView.sh script contains a syntax example for using the cncli ping command if needed:

checkPEER=$(${CNCLI} ping --host "${peerIP}" --port "${peerPORT}" --network-magic "${NWMAGIC}")

  1. PASSING DATA TO GRAFANA

In the Grafana Dashboard Tutorial at Grafana Dashboard Tutorial | Cardano Developer Portal that you linked above, the section Add Data from Adapools to the Dashboard explains how to implement a text-file collector using Prometheus to send any numeric data that you want to Grafana, such as results of peer analysis that you may perform.

  1. DEBUGGING / TROUBLESHOOTING

The following page contains useful information on how to test the text-file collector using Prometheus:

If the data that you collect is available in Prometheus, then expect the same data to be available in Grafana for display in your dashboard.

Automate running the script to refresh the peer analysis on a regular schedule by implementing a cron job or service.

Have fun,

CHG

1 Like

It’s such a comprehensive reply, and thank you so much for the guidance. I also found that ss based script also would work for me. I will implement text-file collector for this data. I’ll share my progress. Bests.