🦏
ETH Home Staking Collection
DVT Home Staking Curriculum
DVT Home Staking Curriculum
  • The DVT Home Staking Curriculum
  • Curriculum breakdown & timeline
  • Understanding ETH validators
    • Introduction to ETH Validators
    • Roles & Responsibilities of a node operator
    • Rewards and penalties
    • Importance of client diversity
    • Distributed Validator Technologies (DVTs)
    • Economics of using DVTs (WIP)
      • Diva Staking (WIP)
      • Obol (WIP)
      • SSV (WIP)
    • Bonded Validators
    • Economics of bonded validators (WIP)
  • Hardware & systems setup
    • Setup Overview
    • Hardware & system requirements
    • Procuring your hardware
    • Assemble your hardware
    • Practicing for free on Cloud VMs
      • Google Cloud
      • Alibaba Cloud
  • Linux OS, Networking, & Security
    • Install and prepare the OS
    • Networking & network security
    • Device level security setup
    • Verifying checksums
  • Installing & configuring your EL+CL clients
    • Set up and configure execution layer client
      • Nethermind
      • Besu
      • Geth
      • Erigon
      • Reth
    • Set up and configure consensus layer client
      • Teku BN
      • Nimbus BN
      • Lodestar BN
      • Lighthouse BN
      • Prysm BN
  • Keystore generation & MEV-Boost
    • Validator key generation
    • Set up and configure MEV-boost
  • Native Solo Staking Setup
    • Validator client setup
      • Teku VC
      • Nimbus VC
      • Lodestar VC
      • Lighthouse VC
      • Prysm VC
    • Depositing 32 ETH into your validator
    • Exiting your validator
  • Monitoring, Maintenance, and Updates
    • Set up monitoring suite
      • Installing & configuring Prometheus
      • Installing & configuring Node Exporter
      • Installing & configuring Grafana
      • Beaconcha.in App API
      • Client Uptime Check
    • Maintenance & Updates
      • Nethermind
      • Besu
      • Teku
      • Nimbus
      • Lodestar
      • Updating the monitoring suite
      • Preparing for Pectra
  • DVT Setup
    • Diva Staking
      • Diva Staking client setup
        • Default - All-in-one setup
        • Advanced - with standalone Lodestar VC
      • Registering your Diva node
      • Updating your Diva client
      • Monitoring your Diva Node
    • Obol
      • Techne Bronze Speedrun (Launchpad)
      • Obol + Bonded Validators (Techne Silver)
        • Obol + Lido CSM
    • SSV
      • SSV + Lido CSM (WIP)
      • SSV Operator
      • SSV Staker
  • Bonded Validators Setup
    • Lido CSM
      • Generating CSM keystores
      • Set Fee Recipient Address
        • Method 1: Configure on validator keys
        • Method 2: Configure on separate validator client
        • Verifying Fee Recipient Registered on MEV Relays
      • Upload/Remove/View validator keys
      • Rewards & bonds
      • Exiting CSM validators
        • "Lazy" exits (TESTNET ONLY)
        • Proper Exits
      • Role/Address management
      • Monitoring
      • Automations
        • CSM with ETHPillar
        • CSM with ETH Docker
        • CSM with Dappnode
    • Puffer
      • Non-Enclave: 2 ETH
    • Ether.fi
      • Receive distributed validator keyshares
    • Stader (WIP)
    • Rocketpool (WIP)
  • Liquid Staking Vaults
    • Stakewise V3
  • Mainnet
    • Mainnet Deployment
    • Heroglpyhs (WIP)
  • Best practices
    • Slashing prevention
    • Maximising uptime and performance
    • Optimising security
    • Managing your withdrawal wallet
  • Tips
    • Advanced networking
    • Downloading files from your node
  • Useful resources
    • General resources
    • Holesky Faucets
  • Automation/tools
    • ETHPillar
    • ETH Docker
    • Automated power on/off
      • Wake-on-LAN (WoL)
      • Network UPS Tools (NUT)
    • Validator Healthcheck Alerts
  • Solo Stakers Guild
    • Lido CSM+SSV+Obol (Testnet)
Powered by GitBook
On this page
  • Download and install Prometheus
  • Configure Prometheus
  • Start the Prometheus service
  1. Monitoring, Maintenance, and Updates
  2. Set up monitoring suite

Installing & configuring Prometheus

PreviousSet up monitoring suiteNextInstalling & configuring Node Exporter

Last updated 5 months ago

Download and install Prometheus

the latest version of Prometheus and run the checksum verification process to ensure that the downloaded file has not been tampered with.

cd
curl -LO https://github.com/prometheus/prometheus/releases/download/v2.55.0/prometheus-2.55.0.linux-amd64.tar.gz
echo "7a6b6d5ea003e8d59def294392c64e28338da627bf760cf268e788d6a8832a23 prometheus-2.55.0.linux-amd64.tar.gz" | sha256sum --check

Each downloadable file comes with it's own checksum. Replace the actual checksum and URL of the download link in the code block above.

Make sure to choose the amd64 version. Right click on the linked text and select "copy link address" to get the URL of the download link to curl.

Expected output: Verify output of the checksum verification

prometheus-2.55.0.linux-amd64.tar.gz: OK

If checksum is verified, extract the files and move them into the /usr/local/bin and /etc/prometheus directories for neatness and best practice. Then, clean up the duplicated copies.

tar xvf prometheus-2.55.0.linux-amd64.tar.gz
sudo cp prometheus-2.55.0.linux-amd64/prometheus /usr/local/bin/
sudo cp prometheus-2.55.0.linux-amd64/promtool /usr/local/bin/
sudo cp -r prometheus-2.55.0.linux-amd64/consoles /etc/prometheus
sudo cp -r prometheus-2.55.0.linux-amd64/console_libraries /etc/prometheus
sudo rm -r prometheus-2.55.0.linux-amd64 prometheus-2.55.0.linux-amd64.tar.gz

Configure Prometheus

Create an account (prometheus) without server access for Prometheus to run as a background service. This restricts potential attackers to only the Prometheus service in the unlikely event that they manage to infiltrate via a compromised client update.

sudo useradd --no-create-home --shell /bin/false prometheus

Create a directory for Prometheus to store the monitoring data. Then set the owner of this and the /etc/prometheus directory to prometheus so that this user can read and write to the directories.

sudo mkdir -p /var/lib/prometheus
sudo chown -R prometheus:prometheus /var/lib/prometheus
sudo chown -R prometheus:prometheus /etc/prometheus

Create a configuration file so that Prometheus knows where to pull data from.

sudo nano /etc/prometheus/prometheus.yml

Paste the configuration parameters below into the file:

1) General + execution client parameters:

global:
  scrape_interval: 15s
scrape_configs:
  - job_name: prometheus
    static_configs:
      - targets:
          - localhost:9090
  - job_name: node_exporter
    static_configs:
      - targets:
          - localhost:9100
  - job_name: nethermind
    static_configs:
      - targets:
          - localhost:6060
global:
  scrape_interval: 15s
scrape_configs:
  - job_name: prometheus
    static_configs:
      - targets:
          - localhost:9090
  - job_name: node_exporter
    static_configs:
      - targets:
          - localhost:9100
  - job_name: 'besu'
    scrape_interval: 15s
    scrape_timeout: 10s
    metrics_path: /metrics
    scheme: http
    static_configs:
      - targets:
          - localhost:9545 
global:
  scrape_interval: 15s
scrape_configs:
  - job_name: prometheus
    static_configs:
      - targets:
          - localhost:9090
  - job_name: node_exporter
    static_configs:
      - targets:
          - localhost:9100
  - job_name: 'geth'
    scrape_interval: 15s
    scrape_timeout: 10s
    metrics_path: /debug/metrics/prometheus
    scheme: http
    static_configs:
      - targets:
          - localhost:6060 
global:
  scrape_interval: 15s
scrape_configs:
  - job_name: prometheus
    static_configs:
      - targets:
          - localhost:9090
  - job_name: node_exporter
    static_configs:
      - targets:
          - localhost:9100
  - job_name: 'erigon'
    scrape_interval: 15s
    scrape_timeout: 10s
    metrics_path: /debug/metrics/prometheus
    scheme: http
    static_configs:
      - targets:
          - localhost:6060 
global:
  scrape_interval: 15s
scrape_configs:
  - job_name: prometheus
    static_configs:
      - targets:
          - localhost:9090
  - job_name: node_exporter
    static_configs:
      - targets:
          - localhost:9100
  - job_name: 'reth'
    scrape_interval: 15s
    scrape_timeout: 10s
    metrics_path: "/"
    scheme: http
    static_configs:
      - targets:
         - localhost:6060 

2) Consensus client parameters:

According to your selected consensus client, append the following block to the general + execution client parameters above.

  - job_name: "teku_beacon" #for consensus client
    scrape_timeout: 10s
    metrics_path: /metrics
    scheme: http
    static_configs:
      - targets: ["localhost:8009"]
  - job_name: "teku_validator" #for validator client
    scrape_timeout: 10s
    metrics_path: /metrics
    scheme: http
    static_configs:
      - targets: ["localhost:8108"]
  - job_name: 'Nimbus_beacon' #for consensus client
    metrics_path: /metrics
    static_configs:
      - targets: ['localhost:8009']
  - job_name: 'Nimbus_validator' #for validator client
    metrics_path: /metrics
    static_configs:
      - targets: ['localhost:8108']
  - job_name: 'lodestar_beacon' #for consensus client
    metrics_path: /metrics
    static_configs:
      - targets: ['localhost:8009']
  - job_name: 'lodestar_validator' #for validator client
    metrics_path: /metrics
    static_configs:
      - targets: ['localhost:5064']
  - job_name: 'lighthouse_beacon' #for consensus client
    metrics_path: /metrics    
    static_configs:
      - targets: ['localhost:8009']
  - job_name: 'lighthouse_validator' #for validator client
    metrics_path: /metrics
    static_configs:
      - targets: ['localhost:8108']
  - job_name: 'prysm_beacon' #for consensus client   
    metrics_path: /metrics
    static_configs:
      - targets: ['localhost:8009']
  - job_name: 'prysm_validator' #for validator client
    metrics_path: /metrics  
    static_configs:
      - targets: ['localhost:8108']

Once you're done, save with Ctrl+O and Enter, then exit with Ctrl+X.

Next, create a systemd configuration file for the Prometheus service to run in the background.

sudo nano /etc/systemd/system/prometheus.service

Paste the configuration parameters below into the file:

[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=prometheus
Group=prometheus
Restart=always
RestartSec=5
ExecStart=/usr/local/bin/prometheus \
  --config.file=/etc/prometheus/prometheus.yml \
  --storage.tsdb.path=/var/lib/prometheus \
  --web.console.templates=/etc/prometheus/consoles \
  --web.console.libraries=/etc/prometheus/console_libraries
[Install]
WantedBy=multi-user.target

Once you're done, save with Ctrl+O and Enter, then exit with Ctrl+X.

Start the Prometheus service

Reload the systemd daemon to register the changes made, start Prometheus, and check its status to make sure its running.

sudo systemctl daemon-reload
sudo systemctl start prometheus.service
sudo systemctl status prometheus.service

Expected output: The output should say Prometheus is “active (running)”. Press CTRL-C to exit and Prometheus will continue to run.

Use the following command to check the logs for any warnings or errors:

sudo journalctl -fu prometheus -o cat | ccze -A

Expected output:

Press CTRL-C to exit.

If the Prometheus service is running smoothly, we can now enable it to fire up automatically when rebooting the system.

sudo systemctl enable prometheus.service
Download
sudo systemctl status prometheus.service