Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions docs/user-guide/deployments-administration/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,59 +508,6 @@ The `meta_client` configures the Metasrv client, including:
- `ddl_timeout`, DDL execution timeout, `10s` by default.
- `tcp_nodelay`, `TCP_NODELAY` option for accepted connections, true by default.

### Monitor metrics options

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

```toml
[export_metrics]
# Whether to enable export_metrics
enable=true
# Export time interval
write_interval = "30s"
```

- `enable`: Whether to enable export_metrics, `false` by default.
- `write_interval`: Export time interval.

#### `self_import` method

If you are using `standalone`, you can use the `self_import` method to export metrics to GreptimeDB itself.

```toml
[export_metrics]
# Whether to enable export_metrics
enable=true
# Export time interval
write_interval = "30s"
[export_metrics.self_import]
db = "information_schema"
```

- `db`: The default database used by `self_import` is `information_schema`. You can also create another database for saving system metrics.

#### `remote_write` method

The `remote_write` method is supported by `datanode`, `frontend`, `metasrv`, and `standalone`.
It sends metrics to a receiver compatible with the [Prometheus Remote-Write protocol](https://prometheus.io/docs/concepts/remote_write_spec/).

```toml
[export_metrics]
# Whether to enable export_metrics
enable=true
# Export time interval
write_interval = "30s"
[export_metrics.remote_write]
# URL specified by Prometheus Remote-Write protocol
url = "http://127.0.0.1:4000/v1/prometheus/write?db=information_schema"
# Some optional HTTP parameters, such as authentication information
headers = { Authorization = "Basic Z3JlcHRpbWVfdXNlcjpncmVwdGltZV9wd2Q=" }
```

- `url`: URL specified by Prometheus Remote-Write protocol.
- `headers`: Some optional HTTP parameters, such as authentication information.

### Heartbeat configuration
Heartbeat configuration is available in `frontend` and `datanode`.
```toml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,7 @@ description: Guide to monitor GreptimeDB standalone instance using Prometheus me

GreptimeDB standalone provides a `/metrics` endpoint on the HTTP port (default `4000`) that exposes [Prometheus metrics](/reference/http-endpoints.md#metrics).

## Monitoring configuration

You can configure GreptimeDB to export metrics to GreptimeDB itself or to an external Prometheus instance.

### Internal Metrics Storage

Configuring GreptimeDB to store its own metrics internally is convenient and recommended for self-monitoring,
it also enables SQL-based querying and analysis.

To enable self-monitoring, configure the `export_metrics` section in your TOML configuration file:

```toml
[export_metrics]
enable = true
# Metrics collection interval
write_interval = "30s"
[export_metrics.self_import]
db = "greptime_metrics"
```

This configuration:
- Collects and writes metrics every 30 seconds.
- 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.

### Export metrics to Prometheus

For environments with existing Prometheus infrastructure,
GreptimeDB can export metrics via the Prometheus remote write protocol.

To do this, configure the `export_metrics` section in your TOML configuration file with the `remote_write` option:

```toml
[export_metrics]
enable=true
write_interval = "30s"
[export_metrics.remote_write]
# URL specified by Prometheus Remote-Write protocol
url = "https://your/remote_write/endpoint"
# Some optional HTTP parameters, such as authentication information
headers = { Authorization = {{Authorization}} }
```

This configuration:
- Sets the export interval to 30 seconds
- Specifies the Prometheus remote write URL, which should point to your Prometheus instance
- Optionally includes HTTP headers for the remote write URL, such as authentication information
You can use Prometheus to scrape these metrics and Grafana to visualize them.

## Grafana Dashboard Integration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,59 +500,6 @@ tcp_nodelay = true
- `ddl_timeout`,DDL 执行的超时时间,默认 10 秒。
- `tcp_nodelay`,接受连接时的 `TCP_NODELAY` 选项,默认为 true。

### 指标监控选项

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

```toml
[export_metrics]
# Whether to enable export_metrics
enable=true
# Export time interval
write_interval = "30s"
```

- `enable`: 是否启用导出指标功能,默认为 `false`。
- `write_interval`: 指标导出时间间隔。

#### `self_import` 方法

如果你使用的是 GreptimeDB 单机版,可以使用 `self_import` 方法将指标导入到自身的数据库中。

```toml
[export_metrics]
# Whether to enable export_metrics
enable=true
# Export time interval
write_interval = "30s"
[export_metrics.self_import]
db = "information_schema"
```

- `db`: 默认的数据库为 `information_schema`,你也可以创建另一个数据库来保存系统指标。

#### `remote_write` 方法

`datanode`、`frontend`、`metasrv` 和 `standalone` 支持使用 `remote_write` 方法导出指标。
它将指标发送到与 [Prometheus Remote-Write protocol](https://prometheus.io/docs/concepts/remote_write_spec/) 兼容的接受端。

```toml
[export_metrics]
# Whether to enable export_metrics
enable=true
# Export time interval
write_interval = "30s"
[export_metrics.remote_write]
# URL specified by Prometheus Remote-Write protocol
url = "http://127.0.0.1:4000/v1/prometheus/write?db=information_schema"
# Some optional HTTP parameters, such as authentication information
headers = { Authorization = "Basic Z3JlcHRpbWVfdXNlcjpncmVwdGltZV9wd2Q=" }
```

- `url`: Prometheus Remote-Write 协议指定的 URL。
- `headers`: 一些可选的 HTTP 参数,比如认证信息。

### 心跳配置
心跳配置在 `frontend` 和 `datanode` 中可用。
```toml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,7 @@ description: 使用 Prometheus 指标和 Grafana 监控 GreptimeDB 单机实例

GreptimeDB 单机版在 HTTP 端口(默认 `4000`)上提供 `/metrics` 端点,暴露 [Prometheus 指标](/reference/http-endpoints.md#指标)。

## 监控配置

你可以配置 GreptimeDB 将指标导出到 GreptimeDB 自身或外部的 Prometheus 实例。

### 将指标存储到 GreptimeDB 自身

将指标存储到 GreptimeDB 自身既方便又推荐用于自监控,且支持基于 SQL 的查询和分析。

要启用自监控,请在你的 TOML 配置文件中配置 `export_metrics` 部分:

```toml
[export_metrics]
enable = true
# 指标收集间隔
write_interval = "30s"
[export_metrics.self_import]
db = "greptime_metrics"
```

此配置:
- 每 30 秒收集和写入指标。
- 将指标导出到 GreptimeDB 内的 `greptime_metrics` 数据库。请确保在导出指标之前 `greptime_metrics` 数据库[已被创建](/reference/sql/create.md#create-database)。

### 导出指标到 Prometheus

对于已有 Prometheus 基础设施的环境,GreptimeDB 可以通过 Prometheus 远程写入协议导出指标。

具体方法为,在 TOML 配置文件中使用 `remote_write` 选项配置 `export_metrics` 部分:

```toml
[export_metrics]
enable=true
write_interval = "30s"
[export_metrics.remote_write]
# Prometheus Remote-Write 协议指定的 URL
url = "https://your/remote_write/endpoint"
# 一些可选的 HTTP 参数,如身份验证信息
headers = { Authorization = {{Authorization}} }
```

此配置:
- 将导出间隔设置为 30 秒
- 指定 Prometheus 远程写入 URL,应指向你的 Prometheus 实例
- 可选择包含远程写入 URL 的 HTTP 头,如身份验证信息
你可以使用 Prometheus 抓取这些指标,并使用 Grafana 进行可视化展示。

## Grafana 仪表板集成

Expand Down