AlloyDB Omni 指标

选择文档版本:

AlloyDB Omni Kubernetes 操作器提供用于监控数据库健康状况和性能的指标。这些指标以适合 Prometheus 爬取的格式公开。

标签

AlloyDB Omni Kubernetes 操作器会公开以下类型的标签。

资源标签

AlloyDB Omni Kubernetes 操作器会公开以下资源标签,用于唯一标识指标所属的数据库容器。这些资源标签与拥有数据库容器的 Kubernetes 资源的名称匹配:

标签键 标签值
dbnamespace dbcluster CR 的命名空间
dbcluster dbcluster CR 的名称
dbinstance dbinstance CR 的名称。仅支持 ReadPool 类型的 dbinstance。如果数据库容器不属于 ReadPool dbinstance,则此值为 n/a
dbnode 实例 CR 的名称。每个实例 CR 都与一个数据库容器具有一对一映射关系。

系统元数据标签

当数据库容器的 roles 发生更改时,系统元数据标签会动态更改。例如,当数据库集群从次要集群提升为主集群时,dbcluster_type 将从 Secondary 更改为 Primary

标签键 标签值
dbcluster_type dbcluster CR 的灾难恢复 (DR) 角色。可以是 PrimarySecondary
dbinstance_type dbinstance CR 的类型。如果容器属于 ReadPool dbinstance,则此值为 ReadPool,否则此值为 n/a
dbnode_type dbnode 的高可用性角色,可以是 PrimaryStandby

指标标签

以下表列出了每项指标的特定标签。例如,database 表示托管在 AlloyDB Omni 数据库容器内的 Postgres 数据库的名称。

指标

AlloyDB Omni Kubernetes 操作器会公开以下指标。指标列表仅提及指标标签。所有指标都以 alloydb_omni 开头。如需详细了解指标类型,请参阅指标类型

数据库容器级指标

数据库容器级指标是按 AlloyDB Omni 数据库容器收集的。每个数据库容器级指标都具有资源和系统元数据标签。

名称 说明 标签 单位 类型
alloydb_omni_database_postgresql_backends 与 AlloyDB Omni 实例建立的活跃连接和空闲连接的数量。 读数
alloydb_omni_database_postgresql_chill_cache_get_entry_calls_total 从超快磁盘缓存检索数据条目的调用总数。 计数器
alloydb_omni_database_postgresql_chill_cache_num_hits_total 从超快磁盘缓存成功检索数据条目的总次数。 prewarm:预热阶段发生的命中 计数器
alloydb_omni_database_postgresql_max_connections Postgres max_connections 运行时参数的当前值。 读数
alloydb_omni_database_postgresql_up Postgres 主进程是否正在运行,如果正在运行,则为 1,否则为 0。 读数
alloydb_omni_database_postgresql_uptime_second 自 Postgres 主进程启动以来经过的时间。 读数
alloydb_omni_database_postgresql_vacuum_oldest_transaction_age 阻止完全清理 (vacuum) 操作的最早未提交事务的当前存在时长。以该最早事务之后启动的事务数量来衡量。 type:running、prepared、replication_slot、replica 中的一个 读数
alloydb_omni_database_postgresql_vacuum_transaction_id_utilization_percentage 所用事务 ID 空间的比率。1 表示 100%。 读数
alloydb_omni_instance_postgresql_backends_by_state 当前连接数。 state:连接的状态,可以是 idle、active、idle_in_transaction、idle_in_transaction_aborted、disabled、fastpath_function_call 中的一个 读数
alloydb_omni_instance_postgresql_backends_for_top_applications 每个应用的当前连接数。 application_name:应用的名称 读数
alloydb_omni_instance_postgresql_blks_hit_count_total Postgres 在缓冲区缓存中找到所请求块的总次数。 计数器
alloydb_omni_instance_postgresql_blks_read_count_total Postgres 读取的不在 Postgres 缓冲区缓存中的块总数。 计数器
alloydb_omni_instance_postgresql_committed_transactions_count_total 已提交的事务总数。 计数器
alloydb_omni_instance_postgresql_deadlock_count_total 检测到的死锁数量。 计数器
alloydb_omni_instance_postgresql_new_connections_count_total 新连接总数。 计数器
alloydb_omni_instance_postgresql_rolledback_transactions_count_total 回滚的事务总数。 计数器
alloydb_omni_instance_postgresql_temp_bytes_written_count_total 查询写入临时文件的数据总量。 字节 计数器
alloydb_omni_instance_postgresql_temp_files_written_count_total 执行内部算法时用于写入数据的临时文件总数。 计数器
alloydb_omni_instance_postgresql_tuples_deleted_count_total 删除的总行数。 计数器
alloydb_omni_instance_postgresql_tuples_fetched_count_total 提取的总行数。 计数器
alloydb_omni_instance_postgresql_tuples_inserted_count_total 插入的总行数。 计数器
alloydb_omni_instance_postgresql_tuples_returned_count_total 返回的总行数。 计数器
alloydb_omni_instance_postgresql_tuples_updated_count_total 已更新总行数。 计数器
alloydb_omni_instance_postgresql_version PostgreSQL 数据库的版本。 读数
alloydb_omni_instance_postgresql_wait_count_total 等待事件的总等待次数。
  • wait_event_name:等待事件的名称
  • wait_event_type:等待事件的类型
计数器
alloydb_omni_instance_postgresql_wait_time_us_total 等待事件的总耗时。
  • wait_event_name:等待事件的名称
  • wait_event_type:等待事件的类型
us 计数器
alloydb_omni_instance_postgresql_replication_flush_lag_ms 在本地 flush 最近的 WAL 与收到副本服务器已写入并 flush 该 WAL(但尚未应用)的通知之间所用时间。
  • application_name:指向主实例的副本连接字符串中与副本实例 CR 名称匹配的 application_name。
  • client_addr:副本 Pod 的 IP 地址。
毫秒 读数
alloydb_omni_instance_postgresql_replication_replay_lag_ms 在本地 flush 最近的 WAL 与收到副本服务器已写入、flush 并应用该 WAL 的通知之间所用时间。
  • application_name:指向主实例的副本连接字符串中的 application_name。它与副本实例 CR 的名称匹配。
  • client_addr:副本 Pod 的 IP 地址。
毫秒 读数
alloydb_omni_instance_postgresql_replication_state 连接到主实例的每个副本的状态。其值始终为 1
  • application_name:指向主实例的副本连接字符串中的 application_name。它与副本实例 CR 的名称匹配。
  • client_addr:副本 Pod 的 IP 地址。
  • 状态:startup、catchup、streaming、backup、stopping 中的一个
读数
alloydb_omni_instance_postgresql_replication_write_lag_ms 在本地 flush 最近的 WAL 与收到副本服务器已写入该 WAL(但尚未 flush 或应用)的通知之间所用时间。
  • application_name:指向主实例的副本连接字符串中的 application_name。它与副本实例 CR 的名称匹配。
  • client_addr:副本 Pod 的 IP 地址。
毫秒 读数
alloydb_omni_memory_available_byte 可供分配的内存量估计值。 字节 读数
alloydb_omni_memory_limit_byte 数据库容器的内存限制,在数据库集群清单文件的 spec 部分的 primarySpec 节中指定。 字节 读数
alloydb_omni_memory_used_byte 无法释放的已用数据库容器内存的估计值。 字节 读数
alloydb_omni_node_cpu_mcpu 分配的 mCPU 数量。1,000 mCPU = 1 个 CPU mCPU 读数
alloydb_omni_node_cpu_usage_second_total 使用的 CPU 总秒数。 计数器
alloydb_omni_node_network_received_bytes_count_total AlloyDB Omni Pod 上网络接收的字节数。 字节 计数器
alloydb_omni_node_network_sent_bytes_count_total AlloyDB Omni Pod 上网络发送的字节数。 字节 计数器
alloydb_omni_node_storage_limit_per_disk_byte 存储空间限制(以字节为单位)。 disk:磁盘的名称 字节 读数
alloydb_omni_node_storage_read_bytes_count_total 从磁盘读取的字节数。 字节 计数器
alloydb_omni_node_storage_read_ops_count_total 磁盘读取 IO 操作数。 计数器
alloydb_omni_node_storage_usage_per_disk_byte 每个磁盘使用的存储空间(以字节为单位)。 disk:磁盘的名称 字节 读数
alloydb_omni_node_storage_write_bytes_count_total 写入到磁盘的字节数。 字节 计数器
alloydb_omni_node_storage_write_ops_count_total 磁盘写入 IO 操作数。 计数器

数据库级指标

这些指标是在每个 Postgres 数据库级按 AlloyDB Omni 数据库容器收集的。您可以在一个数据库容器中创建多个 Postgres 数据库。所有这些指标都具有资源、系统元数据和“数据库”标签。数据库标签是指标所属的 Postgres 数据库的名称。

名称 说明 标签 单位 类型
alloydb_omni_database_postgresql_backends_for_top_databases 每个数据库的当前连接数。 读数
alloydb_omni_database_postgresql_blks_hit_for_top_databases_count_total 每个数据库中,Postgres 在缓冲区缓存中找到所请求块的总次数。 计数器
alloydb_omni_database_postgresql_blks_read_for_top_databases_count_total 每个数据库中,Postgres 读取的不在 Postgres 缓冲区缓存中的块总数。 计数器
alloydb_omni_database_postgresql_committed_transactions_for_top_databases_count_total 每个数据库中已提交的事务总数。 计数器
alloydb_omni_database_postgresql_deadlock_for_top_databases_count_total 每个数据库的死锁数量。 计数器
alloydb_omni_database_postgresql_insights_aggregate_execution_time_us_total 所有查询的总执行时间。
  • user:运行查询的 Postgres 用户。
  • client_addr:如果可用,则为客户端的 IP 地址,否则为空。
us 计数器
alloydb_omni_database_postgresql_insights_aggregate_io_time_us_total 所有查询执行 IO 所花费的总时间。
  • user:运行查询的 Postgres 用户
  • io_type:readwrite
us 计数器
alloydb_omni_database_postgresql_new_connections_for_top_databases_count_total 每个数据库的新连接数。 计数器
alloydb_omni_database_postgresql_rolledback_transactions_for_top_databases_count_total 每个数据库中回滚的事务总数。 计数器
alloydb_omni_database_postgresql_size_byte 数据库大小。 字节 读数
alloydb_omni_database_postgresql_statements_executed_count_total 每个数据库中执行的语句总数。 operation_type:操作的名称,可以是 SELECT、UPDATE、INSERT、DELETE、MERGE、UTILITY、NOTHING、UNKNOWN 中的一个 计数器
alloydb_omni_database_postgresql_temp_bytes_written_for_top_databases_count_total 每个数据库中查询写入临时文件的数据总量。 字节 计数器
alloydb_omni_database_postgresql_temp_files_written_for_top_databases_count_total 每个数据库中在执行内部算法时用于写入数据的临时文件总数。 计数器
alloydb_omni_database_postgresql_tuples 数据库中的行数。 state:live、dead 中的一个 读数
alloydb_omni_database_postgresql_tuples_deleted_for_top_databases_count_total 每个数据库中删除的总行数。 计数器
alloydb_omni_database_postgresql_tuples_fetched_for_top_databases_count_total 每个数据库中提取的总行数。 计数器
alloydb_omni_database_postgresql_tuples_inserted_for_top_databases_count_total 每个数据库中插入的总行数。 计数器
alloydb_omni_database_postgresql_tuples_returned_for_top_databases_count_total 每个数据库中返回的总行数。 计数器
alloydb_omni_database_postgresql_tuples_updated_for_top_databases_count_total 每个数据库中更新的总行数。 计数器

指标收集指标

这些指标表示每个指标收集周期的状态。它们具有标签中提到的资源标签。

名称 说明 单位 类型
alloydb_omni_monitor_collect_ms 收集指标所花费的毫秒数。 毫秒 读数
alloydb_omni_monitor_error_count 尝试在此周期内收集指标时遇到的错误数量。 读数
alloydb_omni_monitor_metric_count 此周期内成功收集的指标数量。 读数

Prometheus 指标处理程序指标

这些指标由 Prometheus 在每个收集周期自动生成。

名称 说明 原因 类型
promhttp_metric_handler_errors_total promhttp 指标处理程序遇到的内部错误总数。 错误原因 计数器

后续步骤