暴露指标
如果你使用的是 ClickHouse Cloud,可以通过 Prometheus 集成 向 Prometheus 暴露指标。
| 名称 | 默认值 | 描述 |
|---|---|---|
port | 无 | 用于提供指标暴露协议服务的端口。 |
endpoint | /metrics | 供 Prometheus 服务器抓取指标的 HTTP 端点。以 / 开头。不得与 <handlers> 部分一起使用。 |
url / headers / method | 无 | 用于查找与请求匹配的处理程序的过滤条件。类似于 <http_handlers> 部分中的同名字段。 |
metrics | true | 导出 system.metrics 表中的指标。 |
asynchronous_metrics | true | 导出 system.asynchronous_metrics 表中的当前指标值。 |
events | true | 导出 system.events 表中的指标。 |
errors | true | 导出自上次服务器重启以来按错误代码统计的错误数。也可从 system.errors 中获取该信息。 |
histograms | true | 导出 system.histogram_metrics 中的直方图指标 |
dimensional_metrics | true | 导出 system.dimensional_metrics 中的带维度指标 |
127.0.0.1 替换为你的 ClickHouse 服务器 IP 地址或主机名) :
Remote-write 协议
ClickHouse 支持 remote-write 协议。 通过该协议接收到的数据会被写入 TimeSeries 表 (该表应预先创建) 。| Name | Default | Description |
|---|---|---|
port | none | 用于提供 remote-write 协议服务的端口。 |
url / headers / method | none | 用于为请求查找匹配处理程序的过滤条件。与 <http_handlers> 部分中同名字段类似。 |
table | none | 用于写入通过 remote-write 协议接收的数据的 TimeSeries 表名。该名称也可以包含数据库名称。 |
database | none | 如果 table 设置中未指定数据库,则使用此项指定 table 设置中所指表所在的数据库名称。 |
Remote-read 协议
ClickHouse 支持 remote-read 协议。 数据会从 TimeSeries 表中读取,并通过该协议发送。| Name | Default | Description |
|---|---|---|
port | none | 用于提供 remote-read 协议服务的端口。 |
url / headers / method | none | 用于查找与请求匹配的处理程序的过滤器。与 <http_handlers> 部分中的同名字段类似。 |
table | none | 用于读取数据并通过 remote-read 协议发送的 TimeSeries 表名称。该名称也可以包含数据库名称。 |
database | none | 如果 table 设置中未指定数据库,则为 table 设置中指定的表所在数据库的名称。 |