Prometheus and Grafana monitoring (optional)

Steps for getting Prometheus and Grafana running

Step 1: Download latest Prometheus release

Latest Prometheus release can be found here, or you can download it (latest version at the time or writing this guide) from terminal using

$ wget https://github.com/prometheus/prometheus/releases/download/v2.27.1/prometheus-2.27.1.linux-amd64.tar.gz
$ tar xvfz prometheus-2.27.1.linux-amd64.tar.gz

This will create prometheus-2.27.1.linux-amd64 folder containing Prometheus binary

Step 2: Write a configuration file for monitoring Orakuru node

Create a prometheus.yml somewhere on your server and add following content:

global:
    scrape_interval: 15s # How often to request metrics
    external_labels:
        monitor: 'orakuru-monitor'

scrape_configs:
    - job_name: 'orakuru'
      # Default interval can be overriden here
      scrape_interval: 5s
      static_configs:
        # This will tell prometheus to collect data from Orakuru node
        # If your Orakuru node instance will be running on a separate server, make sure to change the address here 
        - targets: ['localhost:9000']

This configuration file will tell Prometheus to collect data from your Orakuru node every 5 seconds. You can modify this configuration to suit your needs.

Step 3: Starting Prometheus

You can start Prometheus using

$ ./prometheus --config.file=prometheus.yml

Make sure to replace prometheus.yml with path to your configuration file, if they are not in the same directory.

Step 4: Installing Grafana

In order to keep this guide short, check out official Grafana installation guide for your OS and platform of choice:

Step 5: Add Prometheus data source to Grafana

Open Grafana in your browser (http://your-server-ip:3000), log in with default credentials (admin and admin), change your password to a more secure one, afterwards go to Configuration (gear icon), then Data Sources, and add Prometheus data source. Set URL to your Prometheus server URL.

Last updated

Was this helpful?