Code Monkey home page Code Monkey logo

elrond's Introduction

Description

Easy to use, customizable, bash script collecting data from Elrond nodes and printing them in a Prometheus compatible format.

Elrond Grafana Dashboard

It started as a simple metric exporter used during the battle-of-nodes and with each necessity we added more and more metrics. The slow execution time of bash results in low performance when exporting metrics for more than 10 nodes. It also depends on the host machine.

On a dual-core, HT enabled VM the performance collecting remote metrics for 10 nodes is around 4 seconds on average.

Please keep in mind that this is only an exporter. A complete working setup requires:

  • An existing Grafana installation
  • An existing Prometheus installation
  • Prometheus Node Exporter installed on the host running the elrond-exporter.sh script

If you want to skip the details check our complete, EASY to install monitoring setup.

How to use it

1. Set the Variables

The script collects two types of metrics:

  • Local metrics: Metrics collected from your node RPC/node/status page. Elrond Grafana Dashboard

  • Remote metrics: Metrics collected using an OBSERVER_URL Elrond Grafana Dashboard

The only variable that MUST be setup in order to run the script is IDENTITY:

#Example:
IDENTITY=easy2stake

However, by running the script setting only IDENTITY it will collect validator performance metrics but it will not collect the local metrics, directly from your node http://RPC-URL/node/status.

In order to collect local metrics edit the beginning section of the script like this:

LOCAL_METRICS=1
#Edit the example list below with your own nodes. The RPC port has to be reachable from the location of the script:
LOCAL_NODES=(http://rpc-url:8080 http://rpc-url:8081)

Variables explained:

  • LOCAL_METRICS: Enable (1) or disable (0) the local metrics collection. By default this is set to 0
  • LOCAL_NODES: Array with each one of the node RPC that you want to collect local metrics from
  • REMOTE_METRICS: Enable (1) or disable (0) the remote metrics collection. By default this is set to 1. DO NOT ENABLE this metrics if you are running the script on the same machine as your validator. It can impact validator performance.
  • OBSERVER_URL: The observer to be used in order to collect the REMOTE_METRCS from. By default this is set to https://api.elrond.com
  • IDENTITY: Your keybase identity. This is a mandatory variable.

2. Run the script

By simply running the script it will print the metrics on the terminal.

bash elrond-exporter.sh

Setup cronab and import the metrics to Prometheus using node_exporter collector.

Example on how to start node_exporter with the collector:

ExecStart=/usr/local/bin/node_exporter \
    --collector.cpu \
    --collector.diskstats \
    --collector.filesystem \
    --collector.loadavg \
    --collector.meminfo \
    --collector.systemd \
    --collector.tcpstat \
    --web.listen-address=:9100 \
    --web.telemetry-path="/metrics" \
    --collector.textfile.directory="/home/ubuntu/.elrond-exporter/" #This is the collector line. Change the directory with your own.

Add a cron job to write metrics to collector directory configured in node_exporter:

* * * * * $HOME/elrond/elrond-exporter.sh > $HOME/.elrond-exporter/metrics.prom

Future

A go / python implementation of this exporter.

Reach us on telegram: https://t.me/easy2stake

elrond's People

Contributors

easy2stake avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

elrond's Issues

No metrics if node is offline

We're utilising the script to populate a textfile and then running a cron job for the node exporter as recommended. The script works fantastically to report on the listed metrics as it's running however when the node isn't running all metrics are blank. Could you possible suggest a way to have a metric populated when the node isn't running so that we can trigger an alert from Prometheus ?

please let me know if that doesn't make any sense.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.