Skip to content

Commit 40aae75

Browse files
authored
refactor: add standalone monitoring and remove export metrics (GreptimeTeam#1971)
1 parent b2f0b00 commit 40aae75

File tree

12 files changed

+129
-282
lines changed

12 files changed

+129
-282
lines changed

docs/user-guide/deployments-administration/capacity-plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ there are several key considerations:
1818
- Data retention policy
1919
- Hardware costs
2020

21-
To monitor the various metrics of GreptimeDB, please refer to [Monitoring](/user-guide/deployments-administration/monitoring/export-metrics.md).
21+
To monitor the various metrics of GreptimeDB, please refer to [Monitoring](/user-guide/deployments-administration/monitoring/overview.md).
2222

2323
## CPU
2424

docs/user-guide/deployments-administration/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ The `meta_client` configures the Metasrv client, including:
485485
### Monitor metrics options
486486

487487
These options are used to save system metrics to GreptimeDB itself.
488-
For instructions on how to use this feature, please refer to the [Monitoring](/user-guide/deployments-administration/monitoring/export-metrics.md) guide.
488+
For instructions on how to use this feature, please refer to the [Monitoring](/user-guide/deployments-administration/monitoring/overview.md) guide.
489489

490490
```toml
491491
[export_metrics]

docs/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Guide to deploying monitoring for GreptimeDB clusters on Kubernetes
55

66
# Cluster Monitoring Deployment
77

8-
After deploying a GreptimeDB cluster using GreptimeDB Operator, by default, its components (Metasrv / Datanode / Frontend) expose a `/metrics` endpoint on their HTTP port (default `4000`) for Prometheus metrics.
8+
After deploying a GreptimeDB cluster using GreptimeDB Operator, by default, its components (Metasrv / Datanode / Frontend) expose a `/metrics` endpoint on their HTTP port (default `4000`) for [Prometheus metrics](/reference/http-endpoints.md#metrics).
99

1010
We provide two approaches to monitor the GreptimeDB cluster:
1111

@@ -159,15 +159,6 @@ After configuring `prometheusMonitor`, GreptimeDB Operator will automatically cr
159159
kubectl get podmonitors.monitoring.coreos.com -n ${namespace}
160160
```
161161

162-
:::tip NOTE
163-
The configuration structure has changed between chart versions:
164-
165-
- In older version: `meta.etcdEndpoints`
166-
- In newer version: `meta.backendStorage.etcd.endpoints`
167-
168-
Always refer to the latest [values.yaml](https://github.com/GreptimeTeam/helm-charts/blob/main/charts/greptimedb-cluster/values.yaml) in the Helm chart repository for the most up-to-date configuration structure.
169-
:::
170-
171162
:::note
172163
If not using Helm Chart, you can manually configure Prometheus monitoring in the `GreptimeDBCluster` YAML:
173164

docs/user-guide/deployments-administration/monitoring/export-metrics.md

Lines changed: 0 additions & 128 deletions
This file was deleted.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
keywords: [standalone monitoring, GreptimeDB, metrics, Grafana]
3+
description: Guide to monitor GreptimeDB standalone instance using Prometheus metrics and Grafana.
4+
---
5+
6+
# Standalone Monitoring
7+
8+
GreptimeDB standalone provides a `/metrics` endpoint on the HTTP port (default `4000`) that exposes [Prometheus metrics](/reference/http-endpoints.md#metrics).
9+
10+
## Monitoring configuration
11+
12+
You can configure GreptimeDB to export metrics to GreptimeDB itself or to an external Prometheus instance.
13+
14+
### Internal Metrics Storage
15+
16+
Configuring GreptimeDB to store its own metrics internally is convenient and recommended for self-monitoring,
17+
it also enables SQL-based querying and analysis.
18+
19+
To enable self-monitoring, configure the `export_metrics` section in your TOML configuration file:
20+
21+
```toml
22+
[export_metrics]
23+
enable = true
24+
# Metrics collection interval
25+
write_interval = "30s"
26+
[export_metrics.self_import]
27+
db = "greptime_metrics"
28+
```
29+
30+
This configuration:
31+
- Collects and writes metrics every 30 seconds.
32+
- Exports metrics to the `greptime_metrics` database within GreptimeDB. Ensure the `greptime_metrics` database [is created](/reference/sql/create.md#create-database) before exporting metrics.
33+
34+
### Export metrics to Prometheus
35+
36+
For environments with existing Prometheus infrastructure,
37+
GreptimeDB can export metrics via the Prometheus remote write protocol.
38+
39+
To do this, configure the `export_metrics` section in your TOML configuration file with the `remote_write` option:
40+
41+
```toml
42+
[export_metrics]
43+
enable=true
44+
write_interval = "30s"
45+
[export_metrics.remote_write]
46+
# URL specified by Prometheus Remote-Write protocol
47+
url = "https://your/remote_write/endpoint"
48+
# Some optional HTTP parameters, such as authentication information
49+
headers = { Authorization = {{Authorization}} }
50+
```
51+
52+
This configuration:
53+
- Sets the export interval to 30 seconds
54+
- Specifies the Prometheus remote write URL, which should point to your Prometheus instance
55+
- Optionally includes HTTP headers for the remote write URL, such as authentication information
56+
57+
## Grafana Dashboard Integration
58+
59+
GreptimeDB provides pre-built Grafana dashboards for monitoring standalone deployments.
60+
You can access the dashboard JSON files from the [GreptimeDB repository](https://github.com/GreptimeTeam/greptimedb/tree/VAR::greptimedbVersion/grafana/dashboards/metrics/standalone).
61+
62+

i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/capacity-plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ GreptimeDB 具备超轻量级的启动基准,
1818
- 数据保留策略
1919
- 硬件成本
2020

21-
要监控 GreptimeDB 的各种指标,请参阅[监控](/user-guide/deployments-administration/monitoring/export-metrics.md)
21+
要监控 GreptimeDB 的各种指标,请参阅[监控](/user-guide/deployments-administration/monitoring/overview.md)
2222

2323
## CPU
2424

i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ tcp_nodelay = true
475475
### 指标监控选项
476476

477477
这些选项用于将系统监控指标保存到 GreptimeDB 本身。
478-
有关如何使用此功能的说明,请参见 [监控](/user-guide/deployments-administration/monitoring/export-metrics.md) 指南。
478+
有关如何使用此功能的说明,请参见 [监控](/user-guide/deployments-administration/monitoring/overview.md) 指南。
479479

480480
```toml
481481
[export_metrics]

i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/monitoring/cluster-monitoring-deployment.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: 在 Kubernetes 上部署 GreptimeDB 集群的监控指南,包括
55

66
# 集群监控部署
77

8-
当你使用 GreptimeDB Operator 部署 GreptimeDB 集群后,默认其对应组件(如 Metasrv / Datanode / Frontend)的 HTTP 端口(默认为 `4000`)将会暴露 `/metrics` 端点用于暴露 Prometheus 指标。
8+
当你使用 GreptimeDB Operator 部署 GreptimeDB 集群后,默认其对应组件(如 Metasrv / Datanode / Frontend)的 HTTP 端口(默认为 `4000`)将会暴露 `/metrics` 端点用于暴露 [Prometheus 指标](/reference/http-endpoints.md#指标)
99

1010
我们将提供两种方式来监控 GreptimeDB 集群:
1111

@@ -159,15 +159,6 @@ prometheusMonitor:
159159
kubectl get podmonitors.monitoring.coreos.com -n ${namespace}
160160
```
161161
162-
:::tip NOTE
163-
chart 版本之间的配置结构已发生变化:
164-
165-
- 旧版本: `meta.etcdEndpoints`
166-
- 新版本: `meta.backendStorage.etcd.endpoints`
167-
168-
请参考 chart 仓库中配置 [values.yaml](https://github.com/GreptimeTeam/helm-charts/blob/main/charts/greptimedb-cluster/values.yaml) 以获取最新的结构。
169-
:::
170-
171162
:::note
172163
如果你没有使用 Helm Chart 进行部署,你也可以通过如下 `GreptimeDBCluster` 的 YAML 来手动配置 Prometheus 监控,如下所示:
173164

0 commit comments

Comments
 (0)