Skip to content

Commit e7bdecd

Browse files
authored
Merge 5accb60 into 6878f9b
2 parents 6878f9b + 5accb60 commit e7bdecd

File tree

2 files changed

+124
-33
lines changed

2 files changed

+124
-33
lines changed

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

Lines changed: 64 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,91 @@
1-
# Setting up monitoring for a local {{ ydb-short-name }} cluster
1+
# Setting up monitoring for a {{ 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-
Linked sensors are grouped into a subgroup (such as `counters auth`). To only view sensor values for a particular subgroup, follow a URL like:
11+
- `<ydb-server-address>`: {{ 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>`: {{ ydb-short-name }} port. Default value: 8765.
16+
17+
Linked sensors are grouped into subgroups (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

17-
* `<servicename>`: Sensor subgroup name.
23+
- `<servicename>`: sensor subgroup name.
1824

19-
> For example, data about the utilization of server hardware resources is available at the URL:
20-
>
21-
> ```http
22-
> http://localhost:31002/counters/counters=utils
23-
> ```
25+
For example, data about the utilization of server hardware resources is available at the URL:
2426

25-
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:
27+
```http
28+
http://<ydb-server-address>:<ydb-port>/counters/counters=utils
29+
```
30+
31+
You can collect metric values using [Prometheus](https://prometheus.io/), a popular open-source observability tool, or any other system compatible with its format. {{ 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

31-
* `<servicename>`: Sensor subgroup name.
37+
- `<servicename>`: sensor subgroup name.
3238

33-
To visualize data, use any system that supports Prometheus, such as [Zabbix](https://www.zabbix.com/), [Amazon CloudWatch](https://aws.amazon.com/cloudwatch/), or [Grafana](https://grafana.com/):
39+
To visualize data, use any system that supports Prometheus, such as [Grafana](https://grafana.com/), [Zabbix](https://www.zabbix.com/), or [AWS CloudWatch](https://aws.amazon.com/cloudwatch/):
3440

3541
![grafana-actors](../../_assets/grafana-actors.png)
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/):
46+
47+
1. [Install](https://prometheus.io/docs/prometheus/latest/getting_started) Prometheus.
48+
49+
1. Edit the Prometheus [configuration file](https://github.com/ydb-platform/ydb/tree/main/ydb/deploy/grafana_dashboards/local_ydb_prometheus.yml):
50+
51+
1. In the `targets` section specify addresses of all servers of the {{ ydb-short-name }} cluster and ports for each storage and database node that runs on the server.
52+
53+
For example, for the {{ ydb-short-name }} cluster that contains three servers, each server running one storage node on port 8765 and two database nodes on ports 8766 and 8767, specify nine addresses for all sensor subgroups except for the disk subgroups (for disk sensor subgroups, specify only storage node addresses):
54+
55+
```json
56+
static_configs:
57+
- targets:
58+
- ydb-s1.example.com:8765
59+
- ydb-s1.example.com:8766
60+
- ydb-s1.example.com:8767
61+
- ydb-s2.example.com:8765
62+
- ydb-s2.example.com:8766
63+
- ydb-s2.example.com:8767
64+
- ydb-s3.example.com:8765
65+
- ydb-s3.example.com:8766
66+
- ydb-s3.example.com:8767
67+
```
68+
69+
For a local single-node {{ ydb-short-name }} cluster, specify one address in the `targets` section:
70+
71+
```json
72+
- targets: ["localhost:8765"]
73+
```
74+
75+
1. If necessary, in the `tls_config` section, specify the [CA-issued certificate](./initial-deployment.md#tls-certificates) used to sign the other TLS certificates of the {{ ydb-short-name }} cluster:
76+
77+
```json
78+
tls_config:
79+
ca_file: '<ydb-ca-file>'
80+
```
81+
82+
1. [Run](https://prometheus.io/docs/prometheus/latest/getting_started/#starting-prometheus) Prometheus using the edited configuration file.
83+
84+
1. [Install and start](https://grafana.com/docs/grafana/latest/getting-started/getting-started/) Grafana.
85+
86+
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 the running Prometheus instance.
4087

41-
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).
42-
1. [Install and start](https://grafana.com/docs/grafana/latest/getting-started/getting-started/) the Grafana.
43-
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+
1. Upload [{{ ydb-short-name }} dashboards](https://github.com/ydb-platform/ydb/tree/main/ydb/deploy/helm/ydb-prometheus/dashboards) to Grafana.
4589

4690
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.
4791

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

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

3-
На этой странице рассказано, как настроить мониторинг локального однонодового кластера YDB, запущенного с помощью инструкции по [Быстрому началу работы](../../quickstart.md).
3+
На этой странице рассказано, как настроить мониторинг кластера {{ ydb-short-name }}.
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

17-
* `<servicename>` — имя подгруппы сенсоров.
25+
- `<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

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

31-
* `<servicename>` — имя подгруппы сенсоров.
39+
- `<servicename>` — имя подгруппы сенсоров.
3240

33-
Визуализировать данные можно с помощью любой системы, которая поддерживает формат Prometheus, например [Zabbix](https://www.zabbix.com/ru/), [Amazon CloudWatch](https://aws.amazon.com/ru/cloudwatch/) или [Grafana](https://grafana.com/):
41+
Визуализировать данные можно с помощью любой системы, которая поддерживает формат Prometheus, например [Grafana](https://grafana.com/), [Zabbix](https://www.zabbix.com/ru/) или [Amazon CloudWatch](https://aws.amazon.com/ru/cloudwatch/):
3442

3543
![grafana-actors](../../_assets/grafana-actors.png)
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/):
48+
49+
1. [Установите](https://prometheus.io/docs/prometheus/latest/getting_started) Prometheus.
50+
51+
1. Отредактируйте [файл конфигурации](https://github.com/ydb-platform/ydb/tree/main/ydb/deploy/grafana_dashboards/local_ydb_prometheus.yml) Prometheus:
52+
53+
1. В секции `targets` укажите адреса всех серверов кластера {{ ydb-short-name }} и порты каждого из узлов хранения и узлов базы данных, работающих на сервере.
54+
55+
Например, для кластера из трёх серверов, где на каждом сервере работает один узел хранения на порте 8765 и два узла базы данных на портах 8766 и 8767, необходимо прописать девять адресов для всех подгрупп сенсоров, кроме дисковых (для дисковых подгрупп сенсоров необходимо указать только адреса узлов хранения):
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` укажите [сертификат центра регистрации](./initial-deployment.md#tls-certificates) (Certification Authority, CA), которым подписаны остальные сертификаты TLS кластера {{ ydb-short-name }}:
78+
79+
```json
80+
scheme: https
81+
tls_config:
82+
ca_file: '<ydb-ca-file>'
83+
```
84+
85+
1. [Запустите](https://prometheus.io/docs/prometheus/latest/getting_started/#starting-prometheus) Prometheus, используя отредактированный файл конфигурации.
4086

41-
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).
4287
1. [Установите и запустите](https://grafana.com/docs/grafana/latest/getting-started/getting-started/) Grafana.
88+
4389
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.
90+
91+
1. Загрузите [дашборды {{ ydb-short-name }}](https://github.com/ydb-platform/ydb/tree/main/ydb/deploy/helm/ydb-prometheus/dashboards) в Grafana.
4592

4693
Вы можете загрузить дашборды с помощью инструмента [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. Для других случаев модифицируйте скрипт.
4794

0 commit comments

Comments
 (0)