forked from ton-community/ton-docs
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New translations mytonctrl-prometheus.mdx (Russian)
- Loading branch information
Showing
1 changed file
with
86 additions
and
0 deletions.
There are no files selected for viewing
86 changes: 86 additions & 0 deletions
86
...ocs/current/v3/guidelines/nodes/maintenance-guidelines/mytonctrl-prometheus.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Метрики MyTonCtrl Prometheus | ||
|
||
MyTonCtrl можно настроить для предоставления метрик Prometheus для мониторинга и оповещений. | ||
Это руководство проведет вас через процесс включения метрик Prometheus в MyTonCtrl. | ||
|
||
### Метод доставки метрик | ||
|
||
В настоящее время MyTonCtrl может отправлять метрики только в Prometheus из соображений безопасности. | ||
Поэтому его следует использовать с сервисом [Prometheus Pushgateway](https://github.com/prometheus/pushgateway). | ||
|
||
## Настройка | ||
|
||
:::caution | ||
Для валидаторов настоятельно рекомендуется запускать Prometheus и Pushgateway на отдельном сервере. | ||
::: | ||
|
||
1. Установите Pushgateway | ||
|
||
Вы можете установить службу Pushgateway, следуя инструкциям в [официальной документации](https://github.com/prometheus/pushgateway?tab=readme-ov-file#run-it). | ||
Самый простой способ сделать это — через docker: | ||
|
||
```bash | ||
docker pull prom/pushgateway | ||
docker run -d -p 9091:9091 prom/pushgateway | ||
``` | ||
|
||
2. Настройте Prometheus | ||
|
||
Создайте файл `prometheus.yml`, добавив задание Pushgateway в раздел scrape_configs. Пример файла конфигурации: | ||
|
||
```yaml | ||
global: | ||
scrape_interval: 15s | ||
evaluation_interval: 15s | ||
|
||
scrape_configs: | ||
- job_name: "prometheus" | ||
static_configs: | ||
- targets: ["localhost:9090"] | ||
|
||
- job_name: "pushgateway" | ||
honor_labels: true | ||
static_configs: | ||
- targets: ["localhost:9091"] # or "host.docker.internal:9091" if you are using Docker | ||
``` | ||
3. Установите Prometheus | ||
Вы можете установить Prometheus, следуя инструкциям в [официальной документации](https://prometheus.io/docs/prometheus/latest/installation/). | ||
Самый простой способ сделать это — через docker: | ||
```bash | ||
docker volume create prometheus-data | ||
docker run -d \ | ||
--add-host host.docker.internal:host-gateway \ | ||
-p 9090:9090 \ | ||
-v ./prometheus.yml:/etc/prometheus/prometheus.yml \ | ||
-v prometheus-data:/prometheus \ | ||
prom/prometheus | ||
``` | ||
|
||
4. Настройте MyTonCtrl | ||
|
||
Включите режим `prometheus` в MyTonCtrl: | ||
|
||
```bash | ||
MyTonCtrl> enable_mode prometheus | ||
``` | ||
|
||
Установите URL-адрес Pushgateway: | ||
|
||
```bash | ||
MyTonCtrl> set prometheus_url http://<host>:9091/metrics/job/<jobname> | ||
``` | ||
|
||
:::предупреждение | ||
Обратите внимание, что очень важно использовать разные имена заданий для разных узлов, если вы хотите отслеживать несколько узлов с помощью одного и того же экземпляра Prometheus. | ||
::: | ||
|
||
5. Проверьте показатели | ||
|
||
Вы можете проверить, собирает ли Prometheus показатели, открыв веб-интерфейс Prometheus: | ||
|
||
```bash | ||
http://<host>:9090/targets | ||
``` |