From dc0fdd203dd36a630a66391b9b3ef2241ae15cb8 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Thu, 1 Feb 2024 16:07:22 +0400 Subject: [PATCH] move monitoring to validators --- .../monitoring.md} | 43 ++++++++++++------- 1 file changed, 27 insertions(+), 16 deletions(-) rename docs/{reference/validators-monitoring.md => validators/monitoring.md} (62%) diff --git a/docs/reference/validators-monitoring.md b/docs/validators/monitoring.md similarity index 62% rename from docs/reference/validators-monitoring.md rename to docs/validators/monitoring.md index 6987e8be..9cedf0ce 100644 --- a/docs/reference/validators-monitoring.md +++ b/docs/validators/monitoring.md @@ -1,28 +1,30 @@ ---- -sidebar_label: Validators Monitoring ---- - -## Preview +# Validators Monitoring ![Grafana Preview](/img/docs/grafana-preview.png) ## Prerequisites -First install [Grafana](https://grafana.com) and [Prometheus](https://prometheus.io) on your machine. - +First install [Grafana](https://grafana.com) and +[Prometheus](https://prometheus.io) on your machine. ## Enable tendermint metrics -To enable metrics, you'll have to make an adjustment in the node's `config.toml` file by setting the `prometheus` option to `true`: +To enable metrics, you'll have to make an adjustment in the node's `config.toml` +file by setting the `prometheus` option to `true`: + ```bash sed -i 's/prometheus = false/prometheus = true/g' /home/zetachain/.zetacored/config/config.toml ``` -To apply the modification, it's necessary to restart the node. You should then have the capability to reach the `tendermint` metrics, which are set as the default on port port **26660**: +To apply the modification, it's necessary to restart the node. You should then +have the capability to reach the `tendermint` metrics, which are set as the +default on port port **26660**: ## Configure prometheus targets -Locate the `prometheus.yml` file and add the following `job` entry under the `scrape_configs` section: +Locate the `prometheus.yml` file and add the following `job` entry under the +`scrape_configs` section: + ```yaml - job_name: "zetachain" static_configs: @@ -30,21 +32,28 @@ Locate the `prometheus.yml` file and add the following `job` entry under the `sc labels: instance: "validator" ``` -On Linux machines, you can typically find the `prometheus.yml` file at the following path: `/etc/prometheus/prometheus.yml` + +On Linux machines, you can typically find the `prometheus.yml` file at the +following path: `/etc/prometheus/prometheus.yml` ## Reload Prometheus and Restart Zetachain Reload **Prometheus** configuration: + ```bash curl -X POST http://localhost:9090/-/reload ``` + Restart **Zetachain** Node: + ```bash sudo systemctl restart zetacored ``` ## Configure Grafana -By default, Grafana usually runs on port 3000. You can access Grafana by navigating to the following URL: `http://localhost:3000`. + +By default, Grafana usually runs on port 3000. You can access Grafana by +navigating to the following URL: `http://localhost:3000`. The default username and password is `admin`. @@ -52,12 +61,14 @@ Add your Prometheus Data Source: ![Grafana Config](/img/docs/grafana-config.png) -Click on `Save & test` to test the configuration, if everything is alright you'll see the green message **Data source is working**. - +Click on `Save & test` to test the configuration, if everything is alright +you'll see the green message **Data source is working**. ## Import grafana dashboard -Copy and paste the [Grafana Dashboard ID](https://grafana.com/grafana/dashboards/11036) `11036` and click on `Load` to complete importing. +Copy and paste the +[Grafana Dashboard ID](https://grafana.com/grafana/dashboards/11036) `11036` and +click on `Load` to complete importing. ![Grafana Import](/img/docs/grafana-import.png) @@ -65,4 +76,4 @@ Select your Prometheus as Data Source and click **Import**. At this point, you should be able to monitor your validator node. -![Grafana Preview](/img/docs/grafana-preview.png) \ No newline at end of file +![Grafana Preview](/img/docs/grafana-preview.png)