常见标记
| 标记 | 描述 |
|---|---|
clickhouse_org | 组织 ID |
postgres_service | Postgres 服务 ID |
postgres_service_name | Postgres 服务名称 |
mode、连接中的 state,以及数据库大小中的 database) 。这些都会在对应的各项指标中列出。
信息指标
PostgresServiceInfo 是一个值始终为 1 的 gauge 指标,并通过其标签携带
服务当前的状态和版本。可用它将状态关联到其他指标上,
或在服务离开 running 状态时触发告警。
| 指标 | 类型 | 额外标签 | 说明 |
|---|---|---|---|
PostgresServiceInfo | gauge | postgres_status, postgres_version | 每个服务对应一条时间序列;值始终为 1。 |
postgres_status 用于报告服务当前的生命周期状态
(例如 running、creating、stopped) 。postgres_version
用于报告 Postgres 的主版本号 (例如 17、18) 。
容量
| 指标 | 类型 | 单位 | 描述 |
|---|---|---|---|
PostgresServer_CPUCores | gauge | cores | 分配给服务的 CPU 核心数。 |
PostgresServer_MemoryLimitBytes | gauge | bytes | 分配给服务的内存。 |
PostgresServer_StorageLimitBytes | gauge | bytes | 分配给服务的存储容量。 |
资源利用率
| 指标 | 类型 | 额外标签 | 描述 |
|---|---|---|---|
PostgresServer_CPUSeconds_Total | 计数器 | mode | 已消耗的 CPU 时间,按模式细分:user、system、iowait、softirq、steal、irq、nice、idle。 |
PostgresServer_MemoryUsedPercent | gauge | 已用内存,占 PostgresServer_MemoryLimitBytes 的百分比。 | |
PostgresServer_MemoryCachePercent | gauge | 缓存和缓冲区占用的内存,占总内存的百分比。 | |
PostgresServer_FilesystemUsedPercent | gauge | 已用文件系统空间,占总存储空间的百分比。 |
PostgresServer_CPUSeconds_Total 在你关注的各模式下的速率,并
除以 PostgresServer_CPUCores。
磁盘与网络 I/O
| 指标 | 类型 | 单位 | 说明 |
|---|---|---|---|
PostgresServer_DiskReads_Total | 计数器 | ops | 已完成的磁盘读操作。 |
PostgresServer_DiskWrites_Total | 计数器 | ops | 已完成的磁盘写操作。 |
PostgresServer_NetworkReceiveBytes_Total | 计数器 | bytes | 通过网络接收的字节数。 |
PostgresServer_NetworkTransmitBytes_Total | 计数器 | bytes | 通过网络发送的字节数。 |
数据库活动
rate() 或 irate() 可将其
转换为每秒值。
| 指标 | 类型 | 描述 |
|---|---|---|
PostgresServer_TuplesFetched_Total | 计数器 | 查询拉取的行数。 |
PostgresServer_TuplesInserted_Total | 计数器 | 已插入的行数。 |
PostgresServer_TuplesUpdated_Total | 计数器 | 已更新的行数。 |
PostgresServer_TuplesDeleted_Total | 计数器 | 已删除的行数。 |
PostgresServer_TransactionsCommitted_Total | 计数器 | 已提交的事务数。 |
PostgresServer_TransactionsRolledBack_Total | 计数器 | 已回滚的事务数。 |
PostgresServer_Deadlocks_Total | 计数器 | 检测到的死锁数。 |
连接、缓存和数据库大小
| 指标 | 类型 | 额外标签 | 描述 |
|---|---|---|---|
PostgresServer_ActiveConnections | gauge | state | 按状态划分的连接数 (例如 active、idle) 。 |
PostgresServer_CacheHitRatio | gauge | 缓冲区缓存命中率:以百分比表示由缓存提供的块数占访问块总数的比例。 | |
PostgresServer_DatabaseSizeBytes | gauge | database | 每个数据库的磁盘大小,单位为字节。包括默认的 postgres 数据库以及任何用户创建的数据库。 |
- Prometheus 端点 — 配置、身份验证和抓取
- 仪表板 — Cloud Console 内置图表
- OpenAPI 指南 — 创建 API key 以及查询组织和服务 ID