📖
Stake Local Dashboard
  • Stake Local Dashboard
    • Library Sections
  • Dashboard Installation
    • Installation Overview
    • Install Supporting Software
      • Install Prerequisites
      • Install Prometheus
      • Install Grafana
      • Install node_exporter
      • Install json_exporter
      • Install Ethereum Metrics Exporter
    • Configure Ethereum Clients
    • Configure Supporting Software
      • Configure json_exporter
      • Configure Prometheus Rules
      • Configure Ethereum Metrics Exporter
    • Prometheus Jobs & Targets
      • Prometheus Jobs
      • About Stake Local Labels
      • Base Targets Installation
      • Consensus Client Targets
      • Execution Client Targets
      • Validator Client Targets
      • node_exporter Target
      • json_exporter Target
      • Ethereum Metrics Exporter Targets
      • Third-Party Targets
      • Ethereum Address Targets
      • Validator Public Key Targets
      • Optional: Grafana Target
      • Optional: Prometheus Target
      • Clean Up Unused Targets
    • Optional: Alternative Dashboard Compatibility
      • Besu Dashboard Compatibility
      • Erigon Dashboard Compatibility
      • Geth Dashboard Compatibility
      • Lighthouse Dashboard Compatibility
      • Lodestar Dashboard Compatibility
      • Nethermind Dashboard Compatibility
      • Nimbus Dashboard Compatibility
      • Prysm Dashboard Compatibility
      • Teku Compatibility
    • Enable & Start/Restart Services
      • Checking Software Status
    • Install Dashboard
  • Additional Modifications
    • Additional Staking Groups
    • Change or Add Currency
Powered by GitBook
On this page
  • Prometheus
  • Create System Account
  • Install Prometheus
  • Configure Startup
  • Optional: Clean Up Installation Files
  • Notes
  1. Dashboard Installation
  2. Install Supporting Software

Install Prometheus

Install Prometheus to collect and serve data

PreviousInstall PrerequisitesNextInstall Grafana

Last updated 2 years ago

Prometheus

Prometheus handles data collection, storage, and queries. Data sources are configured as targets from which Prometheus will request metrics data. Prometheus stores this data and responds to Grafana queries against the data.

Create System Account

Create a system account under which Prometheus can run.

sudo adduser --system prometheus --group --no-create-home

Install Prometheus

Download the latest release.

cd
wget https://github.com/prometheus/prometheus/releases/download/v2.42.0/prometheus-2.42.0.linux-amd64.tar.gz

Unpack the release.

tar xzvf prometheus-2.42.0.linux-amd64.tar.gz

Copy multiple executable files to /usr/local/bin.

cd prometheus-2.42.0.linux-amd64
sudo cp -t /usr/local/bin/ prometheus promtool

Create additional required directories.

sudo mkdir -p /etc/prometheus/console_libraries \
    /etc/prometheus/consoles \
    /etc/prometheus/files_sd \
    /etc/prometheus/rules \
    /etc/prometheus/rules.d \
    /var/lib/prometheus

Change ownership on the /var/lib/prometheus directory so the prometheus service can access it.

sudo chown prometheus:prometheus /var/lib/prometheus

Configure Startup

Create a systemd service file to configure automatic startup of the Prometheus service.

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

Insert the following into the Prometheus systemd service file.

[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target

[Service]
User=prometheus
Group=prometheus
Type=simple
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 \
    --storage.tsdb.retention.time=32d
ExecReload=kill -HUP $MAINPID
        
[Install]
WantedBy=multi-user.target

Data retention is set to 32 days in the default configuration. The number of days can be increased by changing the value assigned to the storage.tsdb.retention.time flag in the last line of the ExecStart configuration above.

Save the file and exit the editor.

Optional: Clean Up Installation Files

Remove the Prometheus archive and installation directory.

cd
rm prometheus-2.42.0.linux-amd64.tar.gz
rm -rf prometheus-2.42.0.linux-amd64

Notes

Prometheus will listen on port 9090. This is the port for the Prometheus admin UI.

We have not yet configured nor started Prometheus.

The instructions below are for version 2.42.0. , and adapt the instructions below.

Check for newer versions of Prometheus
Results of adduser command
Results of wget command
Results of tar command