Developer Resources
Block ExplorerGitHubRun a NodeMigration GuideETN Testnet Faucet
  • Overview
  • Foundational topics
    • Intro to the Electroneum Smart Chain
    • Intro to ETN
    • Intro to dapps
    • Web2 vs Web3
    • Accounts
    • Transactions
    • Blocks
    • Electroneum Virtual Machine (EVM)
      • Opcodes
    • Gas and Fees
    • Nodes and clients
    • Networks
    • Consensus mechanisms
      • IBFT
  • Electroneum Stack
    • Intro to the stack
    • Smart contracts
    • Development networks
    • Development frameworks
    • Electroneum client APIs
      • JavaScript APIs
      • JSON-RPC
    • Storage
    • Integrated Development Environments (IDEs)
    • Metamask
  • Advanced
    • Bridges
    • Standards
      • Token standards
        • ERC-20 Fungible Tokens
        • ERC-721 NFTs
    • Oracles
    • Networking layer
      • Network addresses
    • Data structures and encoding
      • Patricia Merkle Trie
      • Recursive-length prefix (RLP)
      • Web3 secret storage definition
  • Design fundamentals
    • Intro to design and UX
  • ETN-SC Client
    • Getting started
      • Introduction
      • Hardware requirements
      • Instaling ETN-SC
    • Fundamentals
      • Command-line options
      • Security
      • Sync-modes
      • Account management
      • Databases
      • Backup & restore
      • Logs
      • Connecting to peers
      • Pruning
      • Private networks
      • Config files
      • Light client
    • Interacting with ETN-SC
      • JSON-RPC Server
        • Batch requests
        • Real-time events
      • JSON-RPC Namespaces
        • admin
        • clique
        • debug
        • eth
        • istanbul
        • les
        • miner
        • net
        • personal
        • txpool
      • JS Console
      • JS Console 2: Contracts
      • GraphQL Server
    • Developers
      • Introduction
      • Dapp developers
        • Dev mode
        • Go API
        • Go Account Management
        • Go Contract Bindings
      • EVM tracing
        • Introduction
        • Basic traces
        • Built-in tracers
        • Custom EVM tracer
        • Tutorial for JavaScript tracing
      • ETN-SC developer
        • Developer guide
        • Disclosures
        • DNS discovery setup guide
        • Code review guidelines
      • Contributing
    • Monitoring
      • Creating Dashboards
      • Understanding Dashboards
      • Ethstats
      • Metrics
    • Tools
      • Clef
        • Introduction
        • APIs
        • Rules
        • Setup
        • Datatypes
        • Tutorial
        • Clique-signing
      • abigen
      • devp2p
    • FAQs
  • Migration to Smart Chain
    • Overview
    • How to Migrate
      • ETN Online Wallets
      • Paper Wallets
      • CLI Wallet Users
      • Exchange Holders
      • Exchanges
    • Bridge Smart Contract
  • Misc. Guides
    • Set up Ledger + Metamask
  • MY.ELECTRONEUM.COM
    • Vendor API
Powered by GitBook
On this page
  • Prerequisites
  • Monitoring stack
  • Setting up InfluxDB
  • Setting up Prometheus
  • Preparing Etn-sc
  • Setting up Grafana
  • Customization
  • Summary

Was this helpful?

  1. ETN-SC Client
  2. Monitoring

Creating Dashboards

PreviousMonitoringNextUnderstanding Dashboards

Last updated 1 year ago

Was this helpful?

There are several ways to monitor the performance of a Etn-sc node. Insights into a node's performance are useful for debugging, tuning and understanding what is really happening when Etn-sc is running.

Prerequisites

To follow along with the instructions on this page it will be useful to have:

  • a running Etn-sc instance.

  • basic working knowlegde of bash/terminal.

provides an excellent introduction to Geth monitoring.

Monitoring stack

An Electroneum Smart Chain client collects lots of data which can be read in the form of a chronological database. To make monitoring easier, this data can be fed into data visualisation software. On this page, a Etn-sc client will be configured to push data into a InfluxDB database and Grafana will be used to visualise the data.

Setting up InfluxDB

InfluxDB can be downloaded from the . It can also be installed from a .

For example the following commands will download and install InfluxDB on a Debian based Linux operating system - you can check for up-to-date instructions for your operating system on the InfluxDB :

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

By default, InfluxDB it is reachable at localhost:8086. Before using the influx client, a new user with admin privileges needs to be created. This user will serve for high level management, creating databases and users.

curl -XPOST "http://localhost:8086/query" --data-urlencode "q=CREATE USER username WITH PASSWORD 'password' WITH ALL PRIVILEGES"
influx -username 'username' -password 'password'

A database and user for Etn-sc metrics can be created by communicating with it directly via its shell.

create database etn
create user etn with password choosepassword

Verify created entries with:

show databases
show users

Leave InfluxDB shell.

exit

InfluxDB is running and configured to store metrics from Etn-sc.

Setting up Prometheus

docker run \
    -p 9090:9090 \
    -v /path/to/prometheus:/etc/prometheus \
    prom/prometheus:latest

Here a example directoy of /path/to/promethus:

prometheus/
├── prometheus.yml
└── record.geth.rules.yml

And an example of prometheus.yml is:

  global:
    scrape_interval: 15s
    evaluation_interval: 15s

  # Load and evaluate rules in this file every 'evaluation_interval' seconds.
  rule_files:
    - 'record.geth.rules.yml'

  # A scrape configuration containing exactly one endpoint to scrape.
  scrape_configs:
    - job_name: 'go-ethereum'
      scrape_interval: 10s
      metrics_path: /debug/metrics/prometheus
      static_configs:
        - targets:
            - '127.0.0.1:6060'
          labels:
            chain: ethereum

Preparing Etn-sc

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

These flags can be provided when Etn-sc is started or saved to the configuration file.

Listing the metrics in the database verifies that Etn-sc is pushing data correctly. In InfluxDB shell:

use etn
show measurements

Setting up Grafana

With the InfluxDB database setup and successfully receiving data from Etn-sc, the next step is to install Grafana so that the data can be visualized.

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

When Grafana is up and running, it should be reachable at localhost:3000. A browser can be pointed to that URL to access a visualization dashboard. The browser will prompt for login credentials (user: admin and password: admin). When prompted, the default password should be changed and saved.

The browser first redirects to the Grafana home page to set up the source data. Click on the "Data sources" icon and then click on "InfluxDB". The following configuration options are recommended:

Name: InfluxDB
Query Language: InfluxQL
HTTP
  URL: http://localhost:8086
  Access: Server (default)
  Whitelisted cookies: None (leave blank)
Auth
  All options left as their default (switches off)
Custom HTTP Headers
  None
InfluxDB Details
  Database: etn
  User: <your-user-name>
  Password: <your-password>
  HTTP Method: GET

Click on "Save and test" and wait for the confirmation to pop up.

Grafana is now set up to read data from InfluxDB. Now a dashboard can be created to interpret and display it. Dashboards properties are encoded in JSON files which can be created by anybody and easily imported. On the left bar, click on the "Dashboards" icon, then "Import".

Customization

Summary

This page has outlined how to set up a simple node monitoring dashboard using Grafana.

NB: this page was adapted from a tutorial on ethereum.org written by Mario Havel

Now the influx client can be used to enter with the new user.

Prometheus can be downloaded from the . There is also a Docker image at , you can run in containerized environments. eg:

Meanwhile, are a powerful feature that allow you to precompute frequently needed or computationally expensive expressions and save their results as new sets of time series. Read more about setting up recording rules at the .

After setting up database, metrics need to be enabled in Etn-sc. Various options are available, as documented in the METRICS AND STATS OPTIONS in etn-sc --help and in our . In this case Etn-sc will be configured to push data into InfluxDB. Basic setup specifies the endpoint where InfluxDB is reachable and authenticates the database.

The following code snippet shows how to download, install and run Grafana on a Debian based Linux system. Up to date instructions for your operating system can be found on the Grafana .

For a Etn-sc InfluxDB monitoring dashboard, copy the URL of and paste it in the "Import page" in Grafana. After saving the dashboard, it should look like this:

For a Etn-sc Prometheus monitoring dashboard, copy the URL of and paste it in the "Import page" in Grafana. After saving the dashboard, it should look like this:

The dashboards can be customized further. Each panel can be edited, moved, removed or added. To learn more about how dashboards work, refer to .

Some users might also be interested in automatic , which sets up alert notifications that are sent automatically when metrics reach certain values. Various communication channels are supported.

This video
Influxdata release page
repository
downloads page
InfluxDB shell
Prometheus
prom/prometheus
Recording rules
official prometheus docs
metrics page
downloads page
this dashboard
this dashboard
Grafana's documentation
alerting