AlloyDB Omni 指标

选择文档版本:

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

标签

AlloyDB Omni 会公开以下类型的标签。

资源标签

AlloyDB Omni 会公开以下资源标签,用于唯一标识指标所属的数据库容器。

标签键 标签值
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) 角色。可以是 Primary 或 Secondary
dbinstance_type dbinstance CR 的类型。如果容器属于 ReadPool dbinstance,则此值为 ReadPool,否则此值为 n/a
dbnode_type dbnode 的高可用性角色,可以是 Primary 或 Standby

指标标签

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

指标

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 数据库的版本。 以 MAJOR.MINOR 格式表示,例如 16.3 读数
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:副本实例的 IP 地址。
毫秒 读数
alloydb_omni_instance_postgresql_replication_replay_lag_ms 在本地 flush 最近的 WAL 与收到副本服务器已写入、flush 并应用该 WAL 的通知之间所用时间。
  • application_name:指向主实例的副本连接字符串中的 application_name。它与副本实例 CR 的名称匹配。
  • client_addr:副本实例的 IP 地址。
毫秒 读数
alloydb_omni_instance_postgresql_replication_state 连接到主实例的每个副本的状态。其值始终为 1。
  • application_name:指向主实例的副本连接字符串中的 application_name。它与副本实例 CR 的名称匹配。
  • client_addr:副本实例的 IP 地址。
  • state:startup、catchup、streaming、backup、stopping 中的一个
读数
alloydb_omni_instance_postgresql_replication_write_lag_ms 在本地 flush 最近的 WAL 与收到副本服务器已写入该 WAL(但尚未 flush 或应用)的通知之间所用时间。
  • application_name:指向主实例的副本连接字符串中的 application_name。它与副本实例 CR 的名称匹配。
  • client_addr:副本实例的 IP 地址。
毫秒 读数
alloydb_omni_memory_available_byte 可供分配的内存量估计值。 字节 读数
alloydb_omni_memory_limit_byte 数据库实例的内存限制,在数据库集群清单文件的 spec 部分的 primarySpec 节中指定。 字节 读数
alloydb_omni_memory_postgresql_shared_buffers_active_byte PostgreSQL 共享缓冲区的当前大小(以字节为单位)。自动内存管理模块会根据内存压力自动调整此值。 字节 读数
alloydb_omni_memory_postgresql_shared_buffers_byte PostgreSQL 共享缓冲区的大小上限(以字节为单位),通过 shared_buffers 参数进行配置。 字节 读数
alloydb_omni_memory_postgresql_shared_buffers_min_byte PostgreSQL 共享缓冲区大小的下限(以字节为单位)。 字节 读数
alloydb_omni_memory_postgresql_terminated_backends_count_total 因内存压力而由自动内存管理模块终止的 PostgreSQL 后端的总数。 计数器
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 实例上网络接收的字节数。 字节 计数器
alloydb_omni_node_network_sent_bytes_count_total AlloyDB Omni 实例上网络发送的字节数。 字节 计数器
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_insights 开头的 client_addr 指标标签仅在您将数据库集群参数中的 google_insights.track_client_address 设置为 on 时才会显示。

  • 只有在满足以下条件时,系统才会启用以 alloydb_omni_database_postgresql_insights_pertag 开头的指标:

名称 说明 标签 单位 类型
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 每个数据库中每位用户的累计查询执行时间。此值等于执行查询所涉及的所有进程的 CPU 时间、I/O 等待时间、锁定等待时间、进程上下文切换时间和调度时间的总和。
  • user:数据库的用户。
  • client_addr:数据库客户端的 IP 地址。
us 计数器
alloydb_omni_database_postgresql_insights_aggregate_io_time_us_total 每个用户在每个数据库中的累计 I/O 时间。
  • user:数据库的用户。
  • client_addr:数据库客户端的 IP 地址。
  • io_type:read 或 write
us 计数器
alloydb_omni_database_postgresql_insights_aggregate_lock_time_us_total 每个用户在每个数据库中的累计锁定等待时间。
  • user:数据库的用户。
  • client_addr:数据库客户端的 IP 地址。
  • lock_type:lw、hw 或 buffer_pin
us 计数器
alloydb_omni_database_postgresql_insights_aggregate_row_count_total 查询执行期间受影响的总行数。
  • user:数据库的用户。
  • client_addr:数据库客户端的 IP 地址。
计数器
alloydb_omni_database_postgresql_insights_aggregate_shared_blk_access_count_total 语句执行访问的共享块(常规表和索引表)。
  • user:数据库的用户。
  • client_addr:数据库客户端的 IP 地址。
  • access_type:hit 或 miss
计数器
alloydb_omni_database_postgresql_insights_perquery_execution_time_us_total 每位用户、每个数据库、每个查询的累计执行时间。此值等于执行查询所涉及的所有进程的 CPU 时间、I/O 等待时间、锁定等待时间、进程上下文切换时间和调度时间的总和。
  • querystring:标准化查询。
  • user:数据库的用户。
  • client_addr:数据库客户端的 IP 地址。
  • query_hash:查询字符串的唯一哈希值。
us 计数器
alloydb_omni_database_postgresql_insights_perquery_io_time_us_total 每个用户、每个数据库、每个查询的累计 I/O 时间。
  • querystring:标准化查询。
  • user:数据库的用户。
  • client_addr:数据库客户端的 IP 地址。
  • io_type:read 或 write
  • query_hash:查询字符串的唯一哈希值。
us 计数器
alloydb_omni_database_postgresql_insights_perquery_lock_time_us_total 每个用户、每个数据库、每个查询的累计锁定等待时间。
  • querystring:标准化查询。
  • user:数据库的用户。
  • client_addr:数据库客户端的 IP 地址。
  • lock_type:lw、hw 或 buffer_pin
  • query_hash:查询字符串的唯一哈希值。
us 计数器
alloydb_omni_database_postgresql_insights_perquery_row_count_total 查询执行期间受影响的总行数。
  • querystring:标准化查询。
  • user:数据库的用户。
  • client_addr:数据库客户端的 IP 地址。
  • query_hash:查询字符串的唯一哈希值。
计数器
alloydb_omni_database_postgresql_insights_perquery_shared_blk_access_count_total 每个查询的语句执行所访问的共享块(常规表和索引表)。
  • querystring:标准化查询。
  • user:数据库的用户。
  • client_addr:数据库客户端的 IP 地址。
  • access_type:hit 或 miss
  • query_hash:查询字符串的唯一哈希值。
计数器
alloydb_omni_database_postgresql_insights_pertag_execution_time_us_total 每位用户、每个数据库、每个标记的累计执行时间。此值等于执行查询所涉及的所有进程的 CPU 时间、I/O 等待时间、锁定等待时间、进程上下文切换时间和调度时间的总和。
  • user:数据库的用户。
  • client_addr:数据库客户端的 IP 地址。
  • action:操作的名称。
  • application:应用的名称。
  • controller:控制器的名称。
  • db_driver:db_driver 的名称。
  • framework:框架的名称。
  • route:路由的名称。
  • tag_hash:标记字符串的唯一哈希值。
us 计数器
alloydb_omni_database_postgresql_insights_pertag_io_time_us_total 每个用户、每个数据库、每个标记的累计 I/O 时间。
  • user:数据库的用户。
  • client_addr:数据库客户端的 IP 地址。
  • action:操作的名称。
  • application:应用的名称。
  • controller:控制器的名称。
  • db_driver:db_driver 的名称。
  • framework:框架的名称。
  • route:路由的名称。
  • io_type:read 或 write
  • tag_hash:标记字符串的唯一哈希值。
us 计数器
alloydb_omni_database_postgresql_insights_pertag_lock_time_us_total 每个用户、每个数据库、每个标记的累计锁定等待时间。
  • user:数据库的用户。
  • client_addr:数据库客户端的 IP 地址。
  • action:操作的名称。
  • application:应用的名称。
  • controller:控制器的名称。
  • db_driver:db_driver 的名称。
  • framework:框架的名称。
  • route:路由的名称。
  • lock_type:lw、hw 或 buffer_pin
  • tag_hash:标记字符串的唯一哈希值。
us 计数器
alloydb_omni_database_postgresql_insights_pertag_row_count_total 查询执行期间受影响的总行数。
  • user:数据库的用户。
  • client_addr:数据库客户端的 IP 地址。
  • action:操作的名称。
  • application:应用的名称。
  • controller:控制器的名称。
  • db_driver:db_driver 的名称。
  • framework:框架的名称。
  • route:路由的名称。
  • tag_hash:标记字符串的唯一哈希值。
计数器
alloydb_omni_database_postgresql_insights_pertag_shared_blk_access_count_total 每个标记的语句执行所访问的共享块(常规表和索引表)。
  • user:数据库的用户。
  • client_addr:数据库客户端的 IP 地址。
  • action:操作的名称。
  • application:应用的名称。
  • controller:控制器的名称。
  • db_driver:db_driver 的名称。
  • framework:框架的名称。
  • route:路由的名称。
  • access_type:hit 或 miss
  • tag_hash:标记字符串的唯一哈希值。
计数器
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 指标处理程序遇到的内部错误总数。 错误原因 计数器

后续步骤