Skip to main content

Інформаційна панель Grafana

Необхідні умови

First install Grafana and Prometheus on your machine.

note

Ви також можете використовувати [Grafana Cloud] (https://grafana.com/products/cloud/) замість того, щоб встановлювати його локально.

Увімкнути метрики

Щоб увімкнути метрики, вам потрібно змінити аргументи CLI вашої ноди і фармера, додавши опцію Prometheus:

для ноди: --prometheus-listen-on 127.0.0.1:9080

для фармера: --prometheus-listen-on 127.0.0.1:9081

Щоб застосувати зміни, необхідно перезапустити ноду та фармера. You should then have the capability to reach the metrics at http://localhost:9080/metrics and http://localhost:9081/metrics.

Налаштування цілей Prometheus

Locate the prometheus.yml file and add the following job entry under the scrape_configs section:

- job_name: "subspace"
static_configs:
- targets: ["localhost:9080"]
labels:
group: 'node'
- targets: ["localhost:9081"]
labels:
group: 'farmer'

On Linux machines, you can typically find the prometheus.yml file at the following path: /etc/prometheus/prometheus.yml

Restart Prometheus with the new configuration.

note

Prometheus can reload its configuration without restarting by using the SIGHUP signal. If you're running on Linux this can be performed by using kill -s SIGHUP <PID>, replacing <PID> with your Prometheus process ID.

Налаштування Grafana

За замовчуванням Grafana зазвичай працює на порту 3000. You can access Grafana by navigating to the following URL: http://localhost:3000.

The default username and password is admin.

Add your Prometheus Data Source:

grafana-config.png

Click 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 20433 and click Load to complete importing:

grafana-import.png

Select your Prometheus as Data Source and click Import.

At this point, you should be able to monitor your node.

grafana-dashboard.png