AlloyDB Omni Kubernetes 操作器提供用于监控数据库运行状况和性能的指标。这些指标以适合 Prometheus 抓取的格式公开。
标签
AlloyDB Omni Kubernetes operator 会公开以下类型的标签。
资源标签
AlloyDB Omni Kubernetes operator 会公开以下资源标签,用于唯一标识指标所属的数据库容器。这些资源标签与拥有数据库容器的 Kubernetes 资源的名称相匹配:
标签键 | 标签值 |
---|---|
dbnamespace | dbcluster CR 的命名空间 |
dbcluster | dbcluster CR 的名称 |
dbinstance | dbinstance CR 的名称。仅支持 ReadPool 类型的 dbinstance。如果数据库容器不属于 ReadPool 数据库实例,则此值为 n/a |
dbnode | 实例 CR 的名称。每个实例 CR 与数据库容器之间是一对一映射。 |
系统元数据标签
当数据库容器的 roles
发生变化时,系统元数据标签将动态更改。例如,当您的 dbcluster 从辅助升级为主时,dbcluster_type 将从 Secondary
更改为 Primary
。
标签键 | 标签值 |
---|---|
dbcluster_type | dbcluster CR 的灾难恢复 (DR) 角色。可以是 Primary 或 Secondary |
dbinstance_type | dbinstance CR 的类型。如果容器属于 ReadPool 数据库实例,则此值为 ReadPool ,否则此值为 n/a |
dbnode_type | dbnode 的高可用性角色,可以是 Primary 或 Standby |
指标标签
下表列出了每个指标的具体标签。例如,database
表示托管在 AlloyDB Omni 数据库容器内的一个 Postgres 数据库的名称。
指标
AlloyDB Omni Kubernetes operator 会公开以下指标。
指标列表仅提及指标标签。所有指标都以 alloydb_omni
开头。如需详细了解指标类型,请参阅指标类型。
数据库容器级指标
系统会按 AlloyDB Omni 数据库容器收集数据库容器级指标。每个数据库容器级指标都具有资源和系统元数据标签。
名称 | 说明 | 标签 | 单位 | 类型 |
---|---|---|---|---|
alloydb_omni_database_postgresql_backends | 与 AlloyDB Omni 实例建立的活跃连接数和空闲连接数。 | 读数 | ||
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_wait_count_total | 等待事件的总等待次数。 |
|
计数器 | |
alloydb_omni_instance_postgresql_wait_time_second_total | 等待事件经过的总时间。 |
|
秒 | 计数器 |
alloydb_omni_instance_postgresql_replication_flush_lag_ms | 在本地刷新近期 WAL 和收到副本服务器已写入和刷新 WAL(但尚未应用)的通知之间经过的时间。 |
|
毫秒 | 读数 |
alloydb_omni_instance_postgresql_replication_replay_lag_ms | 在本地刷新近期 WAL 与收到副本服务器已写入、刷新和应用该 WAL 的通知之间经过的时间。 |
|
毫秒 | 读数 |
alloydb_omni_instance_postgresql_replication_state |
连接到主副本的每个副本的状态。其值始终为 1 。 |
|
读数 | |
alloydb_omni_instance_postgresql_replication_write_lag_ms | 在本地刷新近期 WAL 和收到副本服务器已写入 WAL(但尚未刷新或应用 WAL)的通知之间经过的时间。 |
|
毫秒 | 读数 |
alloydb_omni_memory_available_byte | 可供分配的内存量的估算值。 | 字节 | 读数 | |
alloydb_omni_memory_limit_byte |
数据库集群清单文件的 spec 部分的 primarySpec 部分中指定的数据库容器的内存限制。 |
字节 | 读数 | |
alloydb_omni_memory_used_byte | 无法释放的已用数据库容器内存的估算值。 | 字节 | 读数 | |
alloydb_omni_node_cpu_mcpu | 分配的 mCPU 数量。1000 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 操作数。 | 计数器 |
数据库级指标
这些指标按 AlloyDB Omni 数据库容器和 Postgres 数据库级别收集。 您可以在一个数据库容器中创建多个 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 | 所有查询的总执行时间。 |
|
us | 计数器 |
alloydb_omni_database_postgresql_insights_aggregate_io_time_us_total | 所有查询执行 I/O 所花费的总时间。 |
|
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 指标处理程序遇到的内部错误总数。 | 错误原因 | 计数器 |
后续步骤
- 如需了解如何使用指标进行监控,请参阅监控 AlloyDB Omni。