Monitoring Geth with InfluxDB and Grafana | ethereum.org (2024)

clients

nodes

Intermediate

Monitoring Geth with InfluxDB and Grafana | ethereum.org (1)Mario Havel

Monitoring Geth with InfluxDB and Grafana | ethereum.org (2)

January 13, 2021

Monitoring Geth with InfluxDB and Grafana | ethereum.org (3)4

minute read

minute read

This tutorial will help you set up monitoring for your Geth node so you can better understand its performance and identify potential problems.

Prerequisites

Monitoring stack

An Ethereum client collects lots of data which can be read in the form of a chronological database. To make monitoring easier, you can feed this into data visualisation software. There are multiple options available:

There's also Geth Prometheus Exporter(opens in a new tab), an option preconfigured with InfluxDB and Grafana. You can set it up easily using docker and Ethbian OS(opens in a new tab) for RPi 4.

In this tutorial, we'll set up your Geth client to push data to InfluxDB to create a database and Grafana to create a graph visualisation of the data. Doing it manually will help you understand the process better, alter it, and deploy in different environments.

Setting up InfluxDB

First, let's download and install InfluxDB. Various download options can be found at Influxdata release page(opens in a new tab). Pick the one that suits your environment.You can also install it from a repository(opens in a new tab). For example in Debian based distribution:

2source /etc/lsb-release

3echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

4sudo apt update

5sudo apt install influxdb -y

6sudo systemctl enable influxdb

7sudo systemctl start influxdb

8sudo apt install influxdb-client

After successfully installing InfluxDB, make sure it's running on background. By default, it is reachable at localhost:8086.Before using influx client, you have to create new user with admin privileges. This user will serve for high level management, creating databases and users.

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

Now you can use influx client to enter InfluxDB shell(opens in a new tab) with this user.

1influx -username 'username' -password 'password'

Directly communicating with InfluxDB in its shell, you can create database and user for geth metrics.

1create database geth

2create user geth with password choosepassword

Verify created entries with:

Leave InfluxDB shell.

1exit

InfluxDB is running and configured to store metrics from Geth.

Preparing Geth

After setting up database, we need to enable metrics collection in Geth. Pay attention to METRICS AND STATS OPTIONS in geth --help. Multiple options can be found there, in this case we want Geth to push data into InfluxDB.Basic setup specifies endpoint where InfluxDB is reachable and authentication for the database.

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

This flags can be appended to a command starting the client or saved to the configuration file.

You can verify that Geth is successfully pushing data, for instance by listing metrics in database. In InfluxDB shell:

1use geth

2show measurements

Setting up Grafana

Next step is installing Grafana which will interpret data graphically. Follow installation process for your environment in Grafana documentation. Make sure to install OSS version if you don't want otherwise.Example installation steps for Debian distributions using repository:

1curl -tlsv1.3 --proto =https -sL https://packages.grafana.com/gpg.key | sudo apt-key add -

2echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list

3sudo apt update

4sudo apt install grafana

5sudo systemctl enable grafana-server

6sudo systemctl start grafana-server

When you've got Grafana running, it should be reachable at localhost:3000.Use your preferred browser to access this path, then login with the default credentials (user: admin and password: admin). When prompted, change the default password and save.

You will be redirected to the Grafana home page. First, set up your source data. Click on the configuration icon in the left bar and select "Data sources".

There aren't any data sources created yet, click on "Add data source" to define one.

For this setup, select "InfluxDB" and proceed.

Data source configuration is pretty straight forward if you are running tools on the same machine. You need to set the InfluxDB address and details for accessing the database. Refer to the picture below.

If everything is complete and InfluxDB is reachable, click on "Save and test" and wait for the confirmation to pop up.

Grafana is now set up to read data from InfluxDB. Now you need to create a dashboard which will 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 "Create and Import".

For a Geth monitoring dashboard, copy the ID of this dashboard(opens in a new tab) and paste it in the "Import page" in Grafana. After saving the dashboard, it should look like this:

You can modify your dashboards. Each panel can be edited, moved, removed or added. You can change your configurations. It's up to you! To learn more about how dashboards work, refer to Grafana's documentation(opens in a new tab).You might also be interested in Alerting(opens in a new tab). This lets you set up alert notifications for when metrics reach certain values. Various communication channels are supported.

Last edit: , August 15, 2023

Was this tutorial helpful?

Monitoring Geth with InfluxDB and Grafana | ethereum.org (2024)
Top Articles
Windows 10 - Delete Paired Bluetooth Connection
Blacklists
Overton Funeral Home Waterloo Iowa
El Paso Pet Craigslist
Greedfall Console Commands
30 Insanely Useful Websites You Probably Don't Know About
Craigslist In South Carolina - Craigslist Near You
What is IXL and How Does it Work?
Missing 2023 Showtimes Near Lucas Cinemas Albertville
Unit 1 Lesson 5 Practice Problems Answer Key
The Rise of Breckie Hill: How She Became a Social Media Star | Entertainment
Hope Swinimer Net Worth
Extra Virgin Coconut Oil Walmart
Equipamentos Hospitalares Diversos (Lote 98)
Cambridge Assessor Database
Parent Resources - Padua Franciscan High School
3S Bivy Cover 2D Gen
360 Tabc Answers
My Homework Lesson 11 Volume Of Composite Figures Answer Key
St. Petersburg, FL - Bombay. Meet Malia a Pet for Adoption - AdoptaPet.com
Is A Daytona Faster Than A Scat Pack
A Biomass Pyramid Of An Ecosystem Is Shown.Tertiary ConsumersSecondary ConsumersPrimary ConsumersProducersWhich
BMW K1600GT (2017-on) Review | Speed, Specs & Prices
Dwc Qme Database
Xsensual Portland
The Old Way Showtimes Near Regency Theatres Granada Hills
Garnish For Shrimp Taco Nyt
Caring Hearts For Canines Aberdeen Nc
Utexas Iot Wifi
Dei Ebill
Craftybase Coupon
How to Use Craigslist (with Pictures) - wikiHow
Insidious 5 Showtimes Near Cinemark Southland Center And Xd
LG UN90 65" 4K Smart UHD TV - 65UN9000AUJ | LG CA
Donald Trump Assassination Gold Coin JD Vance USA Flag President FIGHT CIA FBI • $11.73
Ripsi Terzian Instagram
Upstate Ny Craigslist Pets
Help with your flower delivery - Don's Florist & Gift Inc.
Chilangos Hillsborough Nj
Isabella Duan Ahn Stanford
What to Do at The 2024 Charlotte International Arts Festival | Queen City Nerve
St Vrain Schoology
Gon Deer Forum
Spurs Basketball Reference
The 13 best home gym equipment and machines of 2023
Suppress Spell Damage Poe
Diamond Spikes Worth Aj
Dmv Kiosk Bakersfield
Booked On The Bayou Houma 2023
Latest Posts
Article information

Author: Sen. Emmett Berge

Last Updated:

Views: 5789

Rating: 5 / 5 (60 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Sen. Emmett Berge

Birthday: 1993-06-17

Address: 787 Elvis Divide, Port Brice, OH 24507-6802

Phone: +9779049645255

Job: Senior Healthcare Specialist

Hobby: Cycling, Model building, Kitesurfing, Origami, Lapidary, Dance, Basketball

Introduction: My name is Sen. Emmett Berge, I am a funny, vast, charming, courageous, enthusiastic, jolly, famous person who loves writing and wants to share my knowledge and understanding with you.