Skip to content

Commit e4c5267

Browse files
committed
Added information on the Prometheus configuration file
1 parent 57f6f63 commit e4c5267

File tree

2 files changed

+103
-14
lines changed

2 files changed

+103
-14
lines changed

ydb/docs/en/core/devops/manual/monitoring.md

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,37 @@
11
# Setting up monitoring for a local {{ ydb-short-name }} cluster
22

3-
This page provides instructions on how to set up monitoring for a local {{ ydb-short-name }} cluster that is deployed using [Quick start](../../quickstart.md).
3+
This page provides instructions on how to set up monitoring for a {{ ydb-short-name }} cluster.
44

55
{{ ydb-short-name }} has multiple system health sensors. Instant sensor values are available in the web interface:
66

77
```http
8-
http://localhost:31002/counters/
8+
http://<ydb-server-address>:<ydb-port>/counters/
99
```
1010

11+
* <ydb-server-address> – the {{ ydb-short-name }} server address.
12+
13+
For a local {{ ydb-short-name }} cluster that is deployed using [Quick start](../../quickstart.md) use the `localhost` address.
14+
15+
* <ydb-port> – the {{ ydb-short-name }} port. Default value: 8765.
16+
1117
Linked sensors are grouped into a subgroup (such as `counters auth`). To only view sensor values for a particular subgroup, follow a URL like:
1218

1319
```http
14-
http://localhost:31002/counters/counters=<servicename>/
20+
http://<ydb-server-address>:<ydb-port>/counters/counters=<servicename>/
1521
```
1622

1723
* `<servicename>`: Sensor subgroup name.
1824

1925
> For example, data about the utilization of server hardware resources is available at the URL:
2026
>
2127
> ```http
22-
> http://localhost:31002/counters/counters=utils
28+
> http://<ydb-server-address>:<ydb-port>/counters/counters=utils
2329
> ```
2430
2531
You can collect metric values using [Prometheus](https://prometheus.io/), a popular open-source tool. {{ ydb-short-name }} sensor values in [Prometheus format](https://prometheus.io/docs/instrumenting/exposition_formats/) are available at a URL in the following format:
2632
2733
```http
28-
http://localhost:31002/counters/counters=<servicename>/prometheus
34+
http://<ydb-server-address>:<ydb-port>/counters/counters=<servicename>/prometheus
2935
```
3036
3137
* `<servicename>`: Sensor subgroup name.
@@ -36,12 +42,51 @@ To visualize data, use any system that supports Prometheus, such as [Zabbix](htt
3642

3743
## Setting up monitoring with Prometheus and Grafana {#prometheus-grafana}
3844

39-
To set up monitoring for a local single-node {{ ydb-short-name }} cluster using [Prometheus](https://prometheus.io/) and [Grafana](https://grafana.com/):
45+
To set up monitoring for a {{ ydb-short-name }} cluster using [Prometheus](https://prometheus.io/) and [Grafana](https://grafana.com/):
4046

4147
1. [Install and run](https://prometheus.io/docs/prometheus/latest/getting_started/#downloading-and-running-prometheus) Prometheus via a [configuration file](https://github.com/ydb-platform/ydb/tree/main/ydb/deploy/grafana_dashboards/local_ydb_prometheus.yml).
48+
49+
50+
Edit the configuration file before running Prometheus:
51+
52+
1. In the `targets` section specify addresses of all servers of the {{ ydb-short-name }} cluster and ports for each nodes (static and dynamic) that runs on the server.
53+
54+
For example, for the {{ ydb-short-name }} cluster that contains three servers, each server running one static and two dynamic nodes, specify nine addresses for all sensor subgroups, except for the disk subgroups (for disk sensor subgroups, specify only static node addresses):
55+
56+
```json
57+
static_configs:
58+
- targets:
59+
- ydb-s1.example.com:8765
60+
- ydb-s1.example.com:8766
61+
- ydb-s1.example.com:8767
62+
- ydb-s2.example.com:8765
63+
- ydb-s2.example.com:8766
64+
- ydb-s2.example.com:8767
65+
- ydb-s3.example.com:8765
66+
- ydb-s3.example.com:8766
67+
- ydb-s3.example.com:8767
68+
```
69+
70+
For a local single-node {{ ydb-short-name }} cluster, specify one address in the `targets` section:
71+
72+
```json
73+
- targets: ["localhost:8765"]
74+
```
75+
76+
1. If necessary, specify certificates in the `tls_config` section:
77+
78+
```json
79+
tls_config:
80+
ca_file: '<ydb-prometheus-ca-file>'
81+
```
82+
83+
Skip this step for a local single-node {{ ydb-short-name }} cluster.
84+
4285
1. [Install and start](https://grafana.com/docs/grafana/latest/getting-started/getting-started/) the Grafana.
86+
4387
1. [Create](https://prometheus.io/docs/visualization/grafana/#creating-a-prometheus-data-source) a data source of the `prometheus` type in Grafana and attach it to a running Prometheus instance.
44-
1. Upload [{{ ydb-short-name }} dashboards](https://github.com/ydb-platform/ydb/tree/main/ydb/deploy/grafana_dashboards/) to Grafana.
88+
89+
1. Upload [{{ ydb-short-name }} dashboards](https://github.com/ydb-platform/ydb/tree/main/ydb/deploy/helm/ydb-prometheus/dashboards) to Grafana.
4590

4691
To upload dashboards, use the Grafana UI [Import](https://grafana.com/docs/grafana/latest/dashboards/export-import/#import-dashboard) tool or run a [script](https://github.com/ydb-platform/ydb/tree/main/ydb/deploy/grafana_dashboards/local_upload_dashboards.sh). Please note that the script uses [basic authentication](https://grafana.com/docs/grafana/latest/http_api/create-api-tokens-for-org/#authentication) in Grafana. For other cases, modify the script.
4792

ydb/docs/ru/core/devops/manual/monitoring.md

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
11
# Настройка мониторинга локального кластера {{ ydb-short-name }}
22

3-
На этой странице рассказано, как настроить мониторинг локального однонодового кластера YDB, запущенного с помощью инструкции по [Быстрому началу работы](../../quickstart.md).
3+
На этой странице рассказано, как настроить мониторинг кластера YDB.
44

55
{{ ydb-short-name }} предоставляет множество сенсоров состояния системы. Мгновенные значения сенсоров можно посмотреть в веб-интерфейсе:
66

77
```text
8-
http://localhost:31002/counters/
8+
http://<ydb-server-address>:<ydb-port>/counters/
99
```
1010

11+
где:
12+
13+
- <ydb-server-address> – адрес сервера {{ ydb-short-name }}.
14+
15+
Для локального однонодового кластера YDB, запущенного с помощью инструкции по [Быстрому началу работы](../../quickstart.md), используйте адрес `localhost`.
16+
17+
- <ydb-port> – порт {{ ydb-short-name }}. Значение по умолчанию: 8765.
18+
1119
Связанные сенсоры объединены в подгруппы (например `counters auth`). Чтобы посмотреть значения сенсоров только определенной подгруппы, перейдите по URL следующего вида:
1220

1321
```text
14-
http://localhost:31002/counters/counters=<servicename>/
22+
http://<ydb-server-address>:<ydb-port>/counters/counters=<servicename>/
1523
```
1624

1725
* `<servicename>` — имя подгруппы сенсоров.
1826

1927
Например, данные об утилизации аппаратных ресурсов сервера доступны по следующему URL:
2028

2129
```text
22-
http://localhost:31002/counters/counters=utils
30+
http://<ydb-server-address>:<ydb-port>/counters/counters=utils
2331
```
2432

2533
Для сбора значений метрик вы можете использовать популярный инструмент с открытым исходным кодом [Prometheus](https://prometheus.io/). Значения сенсоров {{ ydb-short-name }} в [формате Prometheus](https://prometheus.io/docs/instrumenting/exposition_formats/) доступны по URL следующего вида:
2634

2735
```text
28-
http://localhost:31002/counters/counters=<servicename>/prometheus
36+
http://<ydb-server-address>:<ydb-port>/counters/counters=<servicename>/prometheus
2937
```
3038

3139
* `<servicename>` — имя подгруппы сенсоров.
@@ -36,12 +44,48 @@ http://localhost:31002/counters/counters=<servicename>/prometheus
3644

3745
## Настройка мониторинга с помощью Prometheus и Grafana {#prometheus-grafana}
3846

39-
Чтобы настроить мониторинг локального однонодового кластера {{ ydb-short-name }} с помощью [Prometheus](https://prometheus.io/) и [Grafana](https://grafana.com/):
47+
Чтобы настроить мониторинг кластера {{ ydb-short-name }} с помощью [Prometheus](https://prometheus.io/) и [Grafana](https://grafana.com/):
4048

4149
1. [Установите и запустите](https://prometheus.io/docs/prometheus/latest/getting_started/#downloading-and-running-prometheus) Prometheus, используя [файл конфигурации](https://github.com/ydb-platform/ydb/tree/main/ydb/deploy/grafana_dashboards/local_ydb_prometheus.yml).
50+
51+
Перед использованием, файл конфигурации Prometheus необходимо отредактировать:
52+
53+
1. В секции `targets` укажите адреса всех серверов кластера {{ ydb-short-name }} и порты каждого из узлов (статического и динамического), работающих на сервере.
54+
55+
Например, для кластера из трёх серверов, где на каждом сервере работает один статический и два динамических узла, необходимо прописать девять адресов для всех подгрупп сенсоров, кроме дисковых (для дисковых подгрупп сенсоров необходимо указать только адреса статических узлов):
56+
57+
```json
58+
static_configs:
59+
- targets:
60+
- ydb-s1.example.com:8765
61+
- ydb-s1.example.com:8766
62+
- ydb-s1.example.com:8767
63+
- ydb-s2.example.com:8765
64+
- ydb-s2.example.com:8766
65+
- ydb-s2.example.com:8767
66+
- ydb-s3.example.com:8765
67+
- ydb-s3.example.com:8766
68+
- ydb-s3.example.com:8767
69+
```
70+
71+
Для локального однонодового кластера YDB, в секции `targets` прописывается один адрес:
72+
73+
```json
74+
- targets: ["localhost:8765"]
75+
```
76+
77+
1. При необходимости, укажите сертификат в секции `tls_config`:
78+
79+
```json
80+
tls_config:
81+
ca_file: '<ydb-prometheus-ca-file>'
82+
```
83+
84+
Пропустите этот шаг для локального однонодового кластера {{ ydb-short-name }}.
85+
4286
1. [Установите и запустите](https://grafana.com/docs/grafana/latest/getting-started/getting-started/) Grafana.
4387
1. [Создайте](https://prometheus.io/docs/visualization/grafana/#creating-a-prometheus-data-source) источник данных с типом `prometheus` в Grafana и подсоедините его к запущенному экземпляру Prometheus.
44-
1. Загрузите [дашборды {{ ydb-short-name }}](https://github.com/ydb-platform/ydb/tree/main/ydb/deploy/grafana_dashboards/) в Grafana.
88+
1. Загрузите [дашборды {{ ydb-short-name }}](https://github.com/ydb-platform/ydb/tree/main/ydb/deploy/helm/ydb-prometheus/dashboards) в Grafana.
4589

4690
Вы можете загрузить дашборды с помощью инструмента [Import](https://grafana.com/docs/grafana/latest/dashboards/export-import/#import-dashboard) Grafana UI или выполнить [скрипт](https://github.com/ydb-platform/ydb/tree/main/ydb/deploy/grafana_dashboards/local_upload_dashboards.sh). Обратите внимание, что скрипт использует [базовую аутентификацию](https://grafana.com/docs/grafana/latest/http_api/create-api-tokens-for-org/#authentication) в Grafana. Для других случаев модифицируйте скрипт.
4791

0 commit comments

Comments
 (0)