Giter Club home page Giter Club logo

node-prometheus's Introduction

Matic node Monitoring

Monitor your Heimdall, Bor and Virtual machine node with Prometheus and Grafana

Follow below steps to set up monitoring for you Matic Node

Pre-Requesite: You need to make sure that you Matic Node is setup, including Heimdall and Bor nodes.

Step 1:

By default these changes should have already been made as part of your node setup but incase they're not, you can follow the steps below

You will need to change prometheus flag to true in the config.toml.

To access the config.toml here:

vi ~/.heimdalld/config/config.toml

Make sure that you keep the formatting intact.

Step 2:

Once you have made the changes in the config.toml you will need to stop Heimdall service and restart it. Note that you only need to restart Heimdall service if you have made changes to it.

To stop heimdall service:

sudo service heimdalld stop

To restart heimdall service:

sudo service heimdalld start

Step 3:

You will make changes in the Bor service file. To access the bor.service file you can run this command:

nano /home/ubuntu/node/bor/start.sh

There would be multiple entries. By default the following parameters should be automatically added, but if they're not added then you can the parameters from below.

Now in this you would see multiple paramaters in a list format. Add this in the following format. You can add it anywhere, for example, you can add it after --maxpeers 150

--metrics \
--pprof --pprofport 7071 --pprofaddr '0.0.0.0' \

Note that these parameters should already be added as part of your setup. You only need to add these parameters if they're not already present in the start.sh file.

You need to make sure that the spaces and formatting are intact.

Now you will notice that your bor will stop because we made changes to the service file. You will need to stop the bor service and restart it.

To Stop Bor service:

sudo service bor stop

Note: When you stop the service of Bor you may encounter a warning asking you run systemctl daemon-reload to reload units.

You will need to run this as sudo systemctl daemon-reload. Once this is successfull you can proceed with starting the Bor service.

To Restart Bor service:

sudo service bor start

Step 4:

Clone the Prometheus repository to your remote machine

git clone https://github.com/maticnetwork/node-prometheus.git

And then switch to the Prometheus directory.

Then install Docker by running the following command:

sudo apt install docker-compose

Once Docker is installed then you run docker by running the following command to start Prometheus: sudo docker-compose up -d

Note: If you're getting an error after running docker-compose up -d please run the following commands on your remote machine

sudo usermod -aG docker ubuntu

newgrp docker

And then you can run docker-compose up -d again.

Step 5:

Open Grafana at following URL:

http://host_ip:3000

Note: Ports of 3000 and 9090 need to open on your cloud firewall.

Creating a Proxy Tunnel

This is an optional step.

If you're running your Node on a Cloud service then you can also create a proxy tunnel on your local machine to your Cloud Machine

You can run this command ssh -N -L 3000:0.0.0.0:3000 ubuntu@<your ip address>. There would not be any output for this, however you can then check in your browser and access this URL: :3000

You should be able to login to Grafana dashboard. Else you can always use http://localhost:3000

Grafana default login details

These login credentials can be changed according to user preferences once logged in:

username: admin
password: admin

Grafana datasource configuration and navigation snapshots

Grafana uses web based APIs to connect to prometheus server for indexed data. For that, it needs prometheus host name.

  1. Open grafana at url: http://host_ip:3000. Hover on the setting icon in the left pane and selet Data Sources:

    Screenshot 2020-04-03 at 4 49 47 PM

  2. Notice that Prometheus sample datasource is added and click on the same:

    Screenshot 2020-04-03 at 4 50 14 PM

  3. Change the HTTP url to http://host_ip:9090 and save. Make sure 9090 port is open. Click on Save and Test button to chek if the connection is a success. After the success message, go to Grafana home:

    Screenshot 2020-04-03 at 5 14 53 PM

  4. Click on the Home button on the left top and select the required option (Heimdall-Dashboard/Bor-Dashboard/Node-Dashboard) to view the respective metrics.

    Screenshot 2020-04-03 at 5 39 36 PM

  5. Notice Heimdall-Dashboard loaded as below

    Screenshot 2020-04-03 at 5 46 49 PM

  6. Notice Bor-Dashboard loaded as below

    Screenshot 2020-04-07 at 1 23 47 PM

  7. Notice Node-Dashboard loaded as below

    Screenshot 2020-04-07 at 1 23 18 PM

node-prometheus's People

Contributors

delroybosco avatar ramakrishna183 avatar jdkanani avatar

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.