GithubHelp home page GithubHelp logo

guillaumemiralles / prysm-grafana-dashboard Goto Github PK

View Code? Open in Web Editor NEW
62.0 6.0 19.0 416 KB

Guide step to step to get a Prysm dashboard using Grafana and Prometheus with mobile alerts

prysm grafana prometheus eth2 ethereum staking

prysm-grafana-dashboard's Introduction

Grafana is an open-source data metrics tool that is used to aggregate large amounts of data into a comprehensive visual dashboard for easy analysis. This section includes instructions for installing Grafana on the local machine and configuring Telegram or Discord alerts for monitoring validator status on-the-go.

Grafana dashboard for prysm node and validator

Getting account metrics

Ensure metrics have been activated by visiting the following dashboards:

Note: Slasher isn't mandatory for staking, only people that are running a slasher can find the metrics at the port 8082. For those that doesn't run a slasher, everything that follows remain correct.

Installing Prometheus

Prometheus must first be installed to fetch the data from the beacon node and validator for Grafana to display.

  1. Download the Prometheus files suited for the host system.

  2. Extract the archive and enter it's new directory.

  3. Locate the prometheus.yml file and replace the contents with the following:

global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets:
      # - alertmanager:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  - job_name: 'validator'
    static_configs:
      - targets: ['localhost:8081']
  - job_name: 'beacon node'
    static_configs:
      - targets: ['localhost:8080']
  - job_name: 'slasher'
    static_configs:
      - targets: ['localhost:8082']
  1. In the same directory, double-click the prometheus file (with extension .exe in Windows) to start Prometheus, or do so in a terminal by issuing the command:
./prometheus

A terminal will open presenting the Prometheus log.

NOTICE: Prometheus' default data logging time is 15 days. To extend dashboard statistics to 31 days, add --storage.tsdb.retention.time=31d to this startup command.

  1. Navigate to http://localhost:9090/graph in a browser. It will present a page similar to this: Prometheus page

Take note of the validator_statuses and total_voted_target_balances, as they are required later.

(Optional) Windows: Running Prometheus in the background

In a Windows Powershell prompt, navigate to the directory the prometheus.exe file is saved and issue the command:

Start-Process "prometheus.exe" "--storage.tsdb.retention.time=31d" -WindowStyle Hidden

To stop the prometheus process at any time, open the windows task manager and search for prometheus.exe, then end the task.

Installing Grafana

Grafana must now be installed to provide the graphical component of the data analytics.

  1. download Grafana and install it.

  2. Open http://localhost:3000 in a browser. By default, the username and the password to this panel are both ‘admin’.

  3. Create a data source and choose Prometheus, then enter in the URL field http://localhost:9090.

  4. click on Save & Test.

A green notification saying “Datasource updated” should now be visible on the upper right corner.

Enabling mobile alerts

  1. On the left menu of Grafana, select Notification channels under the bell icon.

  2. Click on New channel.

Option 1: Telegram

  1. Select Telegram from the list.

  2. To complete the Telegram API settings, a Telegram channel and bot are required. For instructions on setting up a bot with @Botfather, see this section of the Telegram documentation.

  3. Once completed, invite the bot to the newly created channel.

Option 2: Discord

  1. Select Discord in the type drop down selection.

  2. To complete the set up, a Discord server (and a text channel available) as well as a Webhook URL are required. For instructions on setting up a Discord's Webhooks, see this section of their documentation.

  3. Navigate back to http://localhost:3000 and enter the Webhook URL in the Discord notification settings panel.

  4. Click Send Test, which will push a confirmation message to the Discord channel.

Creating and importing dashboards

  1. The dashboard can now be customised to the users preferences. There are two examples that can be used:
  1. To import this json into the Grafana dashboard, click on the + icon on the left menu and select 'Import',

  2. Paste the json and click the Load button.

Running nodes and validators on separate hardware

For those running their node and validators on separate machines, simply modify the pasted prometheus.yml data from the earlier step and change any instances of localhost to the desired IP. For local networks, the private IP is required. For connections over the internet, the public facing IP will be required.

NOTICE: In case of public IPs, port forwarding may need to be configured.

Activate currency converter feature

A specific guide has been designed for it

prysm-grafana-dashboard's People

Contributors

guillaumemiralles avatar ncitron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

prysm-grafana-dashboard's Issues

unable to import dashboard using API

hi there, I'm working on some (Ansible) scripts to automate the provisioning of a eth2 validator with prometheus, Grafana and your dashboard. I'm roughly automating these instructions:
https://medium.com/@SomerEsat/guide-to-staking-on-ethereum-2-0-ubuntu-prysm-witti-2b972e697918
but for the Grafana setup I'm using the API (POST /api/dashboards/db), rather then manually copying and pasting the content into the webpage.

However when I try to import the 'less_10_validators.json' content I receive the following API error message back:

{'message': 'Alert validation error: Data source used by alert rule not found, alertName=WARN NODE/VALIDATOR: The process just restarted, datasource='}

it will not import the dashboard. Any idea what that means? When I use the Grafana UI to import the json, it will accept it, although I also get an error popup with the message:

Templating
Template variables could not be initialized: Unable to load datasource meta data

I'm using Grafana version 7.0.3
thanks

No value for total_voted_target_balances on mainnet?

I'm following this guide: https://docs.prylabs.network/docs/prysm-usage/monitoring/grafana-dashboard

I'm not sure if I'm doing something wrong, or if there is an issue with the dashboard. or the fact that as of time of writing this - the mainnet is not yet running.

My problem is that I can't get the key for total_voted_target_balances which seems to be important.

I can find "validator_statuses", but the "total_voted_target_balances" is not there at all. No key nor value.

No validator_balance from metrics

Hi,

The issue is that: I imported the dashboard successfully but It could not found validator_balance metric from some of the panels. According to this prometheus has only validators_total_balance. This prometheus links to both beacon and validator nodes.
Screenshot 2020-05-09 at 22 12 48

I already pull the latest prysm's client. Do you have any idea of the issue?

Thanks.

Dashboard mixes data from different prometheus jobs

In our setup we have mainnet and testnet validators monitored by one prometheus instance.
Prometheus config includes jobs for testnet and mainnet nodes

  - job_name: 'testnet eth2 validator'
    static_configs:
      - targets: ['redacted']
  - job_name: 'testnet eth2 beacon node'
    static_configs:
      - targets: ['redacted']
  - job_name: 'mainnet eth2 validator'
    static_configs:
      - targets: ['redacted']
  - job_name: 'mainnet eth2 beacon node'
    static_configs:
      - targets: ['redacted']

The dashboards from this repo mix data from mainnet and testnet. Setting dashboard variables validator_job to mainnet eth2 validator and node_job to mainnet eth2 beacon node does not work.

Failed to upgrade legacy querise

Hi. I'm trying to import dashboard but after I hit import this error is displayed. The dashboard is actually imported but it does not work
graph

is node_exporter required?

I originally came to your project from here:
https://medium.com/@SomerEsat/guide-to-staking-on-ethereum-2-0-ubuntu-prysm-witti-2b972e697918
but noticed an inconsistency with the readme for your dashboard.

Somer's tutorial includes instructions for installing and running node_exporter, and it's prometheus configuration included this scrape config:

 - job_name: 'node_exporter'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9100']

However your readme and example Prometheus config makes no mention of node_exporter.
Does your dashboard use the node_exporter metrics at all?

Also, how is your dashboard different from the dashboard linked in the prylabs docs?
https://docs.prylabs.network/docs/prysm-usage/monitoring/grafana-dashboard/

thanks

Parse error(s) in >10 validators json

In the CPU graphing:
parse error at char 60: unexpected metric identifier \":5s\" in range selector, expected \"]\""

Earnings data:
"parse error at char 184: range specification must be preceded by a metric selector, but follows a *promql.AggregateExpr instead"

Telegram alerts are not working

I setup my grafana dashboard and was able to verify that it is connecting to telegram bot by hitting the test button. I am able to get the test message.

However, when I try to disable my validator node by shutting it down, I do not get any alerts from telegram bot. I tried waiting for more than 1 minute and still didn't get alerted by Telegram Bot.

I'm attaching a screenshot of my dashboard, the alerts window seems empty.

Is there any steps or configuration that is missing?

image

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.