Odak modu
In this chapter, we will learn how to monitor our entire network with the help of tools like Prometheus and Grafana.
Install Prometheus and Grafana -
Since this chapter is about using Prometheus and Grafana for substrate, we need these installed in our system. Depending on the operating system you have, you will need to follow different set of instructions for both Prometheus and Grafana.
https://www.digitalocean.com/community/tutorials/how-to-install-prometheus-on-ubuntu-16-04
http://www.liferaysavvy.com/2021/07/prometheus-installation-on-windows.html
Configure Prometheus endpoint
Let’s first start a substrate node, start a terminal and cd into the project and then run the below command -
./target/release/node-template --dev
For example, add a section similar to the following:
# A scrape configuration containing exactly one endpoint to scrape:
scrape_configs:
- job_name: "substrate_node"
scrape_interval: 5s
static_configs:
- targets: ["localhost:9615"]
Start a Prometheus instance with the modified prometheus.yml configuration file.
For example, if you are currently in the Prometheus working directory and using the default configuration file name, start Prometheus by running the following command:
./prometheus --config.file prometheus.yml
OR USE THE BELOW COMMAND -
sudo -u prometheus /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
Open a new terminal shell and check the metrics retrieved for the Substrate node by running the following command:
curl localhost:9615/metrics
Configure Grafana data source
After you start Grafana, you can navigate to it in a browser.
Import template dashboard
If you want a basic dashboard to start, you can import a Substrate dashboard template to get basic information about your node.
To import the dashboard template:
Yazılım Kariyerinde İlerlemeni Hızlandıracak Programlar
Patika+ programlarımız ile 4-8 aylık yoğun yazılım kamplarına katıl, temel bilgilerden başlayarak kapsamlı bilgiler edin, yazılım kariyerine başla!
Yorum yapabilmek için derse kayıt olmalısın!