|
1 |
| -# Setting up monitoring for a local {{ ydb-short-name }} cluster |
| 1 | +# Setting up monitoring for a {{ ydb-short-name }} cluster |
2 | 2 |
|
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. |
4 | 4 |
|
5 | 5 | {{ ydb-short-name }} has multiple system health sensors. Instant sensor values are available in the web interface:
|
6 | 6 |
|
7 | 7 | ```http
|
8 |
| -http://localhost:31002/counters/ |
| 8 | +http://<ydb-server-address>:<ydb-port>/counters/ |
9 | 9 | ```
|
10 | 10 |
|
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: |
12 | 18 |
|
13 | 19 | ```http
|
14 |
| -http://localhost:31002/counters/counters=<servicename>/ |
| 20 | +http://<ydb-server-address>:<ydb-port>/counters/counters=<servicename>/ |
15 | 21 | ```
|
16 | 22 |
|
17 |
| -* `<servicename>`: Sensor subgroup name. |
| 23 | +- `<servicename>`: sensor subgroup name. |
18 | 24 |
|
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: |
24 | 26 |
|
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: |
26 | 32 |
|
27 | 33 | ```http
|
28 |
| -http://localhost:31002/counters/counters=<servicename>/prometheus |
| 34 | +http://<ydb-server-address>:<ydb-port>/counters/counters=<servicename>/prometheus |
29 | 35 | ```
|
30 | 36 |
|
31 |
| -* `<servicename>`: Sensor subgroup name. |
| 37 | +- `<servicename>`: sensor subgroup name. |
32 | 38 |
|
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/): |
34 | 40 |
|
35 | 41 | 
|
36 | 42 |
|
37 | 43 | ## Setting up monitoring with Prometheus and Grafana {#prometheus-grafana}
|
38 | 44 |
|
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. |
40 | 87 |
|
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. |
45 | 89 |
|
46 | 90 | 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.
|
47 | 91 |
|
|
0 commit comments