Performance monitor

Being an Ethereum client, Raylz generates a wealth of data that can be structured into a chronological database. By combining InfluxDB, Prometheus, and Grafana, Raylz can run a monitoring stack for debugging and fine-tuning node operations.

Follow the instructions below to set up the monitoring stack. Instructions are divided into the stack's individual components.

Prerequisites

Before you begin configuring the monitoring stack, make sure you have:

  • a running Raylz instance

  • basic knowledge of bash/terminal

Watch this informative video for a comprehensive introduction to Raylz monitoring.

[embed video]

Set up InfluxDB

InfluxDB provides the structure for a chronological database. Follow the instructions below to set up the database on a Linux system.

  1. Install InfluxDB using the following commands (for Debian-based Linux).

    curl -tlsv1.3 --proto=https -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add
    source /etc/lsb-release
    echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
    sudo apt update
    sudo apt install influxdb -y
    sudo systemctl enable influxdb
    sudo systemctl start influxdb
    sudo apt install influxdb-client
  2. Create a new user with admin privileges.

    curl -XPOST "http://localhost:8086/query" --data-urlencode "q=CREATE USER username WITH PASSWORD 'password' WITH ALL PRIVILEGES"
  3. Enter the InfluxDB shell as the new user.

    influx -username 'username' -password 'password'
  4. Create a database and user for Raylz metrics.

    create database raylz
    create user raylz with password choosepassword
  5. Verify the created entries.

    show databases
    show users
  6. Exit InfluxDB shell.

Set up Prometheus

Prometheus is required to enable metrics in Raylz. Use the instructions provided below to configure Prometheus for your system.

  1. Download and run Prometheus in a Docker container.

    docker run -p 9090:9090 -v /path/to/prometheus:/etc/prometheus prom/prometheus:latest
  2. Create a prometheus.yml configuration file.

    global:
      scrape_interval: 15s
      evaluation_interval: 15s
    
    rule_files:
      - 'record.raylz.rules.yml'
    
    scrape_configs:
      - job_name: 'raylz-ethereum'
        scrape_interval: 10s
        metrics_path: /debug/metrics/prometheus
        static_configs:
          - targets:
              - '127.0.0.1:6060'
            labels:
              chain: ethereum
  3. Prepare and set up recording rules for Prometheus.

  4. Enable metrics in Raylz by specifying the InfluxDB endpoint and authentication.

raylz --metrics --metrics.influxdb --metrics.influxdb.endpoint "http://0.0.0.0:8086" --metrics.influxdb.username "raylz" --metrics.influxdb.password "chosenpassword"

Set up Grafana

  1. Run the commands provided below to install Grafana.

    curl -tlsv1.3 --proto=https -sL https://packages.grafana.com/gpg.key | sudo apt-key add -
    echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
    sudo apt update
    sudo apt install grafana
    sudo systemctl enable grafana-server
    sudo systemctl start grafana-server
  2. Access Grafana at localhost:3000 in a browser. Change the default password.

  3. Configure InfluxDB as a data source with the following criteria:

    • Name: InfluxDB

    • Query Language: InfluxQL

    • HTTP URL: http://localhost:8086

    • Database: raylz

    • User/Password: /

    • HTTP Method: GET Save and test the configuration.

  4. Import the provided dashboard for Raylz monitoring.

Additional Grafana features

Grafana offers automatic alerts and dashboard customization.

To set up alerts, refer to Grafana's OnCall documentation. This tool offers extensive control over event notifications.

For more information about customizing dashboards, please see Grafana's content on building dashboards.

Last updated