AlloyDB Omni 指標

選取文件版本:

AlloyDB Omni 提供指標,可監控資料庫的健康狀態和效能。這些指標會以適合 Prometheus 抓取的格式公開。

標籤

AlloyDB Omni 會公開下列類型的標籤。

資源標籤

AlloyDB Omni 會公開下列資源標籤,用來專屬識別指標所屬的資料庫容器。這些資源標籤與擁有資料庫容器的 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 的 HA 角色,可以是 PrimaryStandby

指標標籤

下表列出各項指標的具體標籤。舉例來說,database 是指 AlloyDB Omni 資料庫容器內代管的 Postgres 資料庫名稱。

指標

AlloyDB Omni 會公開下列指標。 指標清單只會提及指標標籤。所有指標都以 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 從超快速磁碟快取成功擷取資料項目的總數。 預熱:預熱階段發生的點擊 計數器
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 作業的最舊未提交交易目前存在時間。計算方式為最舊交易之後開始的交易數量。 類型:[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:等待事件的類型
美國 計數器
alloydb_omni_instance_postgresql_replication_flush_lag_ms 從本機排清最近的 WAL,到收到副本伺服器已寫入並排清 WAL (但尚未套用) 的通知,這段時間的長度。
  • application_name:副本連線字串中與副本執行個體 CR 名稱相符的主要項目 application_name。
  • client_addr:副本執行個體的 IP 位址。
毫秒 取樣
alloydb_omni_instance_postgresql_replication_replay_lag_ms 從本機排清最近的 WAL,到收到副本伺服器已寫入、排清及套用 WAL 的通知,這段時間的長度。
  • application_name:副本連線字串中主要項目的 application_name。這與副本執行個體 CR 的名稱相符。
  • client_addr:副本執行個體的 IP 位址。
毫秒 取樣
alloydb_omni_instance_postgresql_replication_state 連線至主要執行個體的每個副本狀態。這個值一律為 1
  • application_name:副本連線字串中主要項目的 application_name。這與副本執行個體 CR 的名稱相符。
  • client_addr:副本執行個體的 IP 位址。
  • 狀態:[startup、catchup、streaming、backup、stopping] 其中之一
取樣
alloydb_omni_instance_postgresql_replication_write_lag_ms 從本機排清最近的 WAL,到收到副本伺服器已寫入 (但尚未排清或套用) 的通知之間經過的時間。
  • application_name:副本連線字串中主要項目的 application_name。這與副本執行個體 CR 的名稱相符。
  • client_addr:副本執行個體的 IP 位址。
毫秒 取樣
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 執行個體接收的網路位元組數。 位元組 計數器
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 作業數。 計數器

資料庫層級指標

這些指標是在每個 PostgreSQL 資料庫層級,針對每個 AlloyDB Omni 資料庫容器收集。 您可以在一個資料庫容器中建立多個 Postgres 資料庫。所有這些指標都有資源、系統中繼資料和「資料庫」標籤。資料庫標籤是指標所屬的 Postgres 資料庫名稱。

某些標籤和指標的顯示條件如下:

  • 只有在資料庫叢集參數中將 google_insights.track_client_address 設為 on 時,才會顯示以 alloydb_omni_database_postgresql_insights 開頭的 client_addr 指標標籤。

  • 只有在符合下列條件時,系統才會啟用以 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 作業時間、IO 等待時間、鎖定等待時間、程序內容變更,以及查詢執行作業中的所有程序排程。
  • user:資料庫使用者。
  • client_addr:資料庫用戶端的 IP 位址。
美國 計數器
alloydb_omni_database_postgresql_insights_aggregate_io_time_us_total 每個資料庫中,每位使用者的累計 I/O 時間。
  • user:資料庫使用者。
  • client_addr:資料庫用戶端的 IP 位址。
  • io_typereadwrite
美國 計數器
alloydb_omni_database_postgresql_insights_aggregate_lock_time_us_total 每個資料庫中,每位使用者的累計鎖定等待時間。
  • user:資料庫使用者。
  • client_addr:資料庫用戶端的 IP 位址。
  • lock_typelwhwbuffer_pin
美國 計數器
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_typehitmiss
計數器
alloydb_omni_database_postgresql_insights_perquery_execution_time_us_total 每位使用者、每個資料庫、每項查詢的累計執行時間。也就是下列項目的總和:CPU 作業時間、IO 等待時間、鎖定等待時間、程序內容變更,以及查詢執行作業中的所有程序排程。
  • querystring:正規化查詢。
  • user:資料庫使用者。
  • client_addr:資料庫用戶端的 IP 位址。
  • query_hash:查詢字串的專屬雜湊。
美國 計數器
alloydb_omni_database_postgresql_insights_perquery_io_time_us_total 每個查詢中,每位使用者在每個資料庫的累計 I/O 時間。
  • querystring:正規化查詢。
  • user:資料庫使用者。
  • client_addr:資料庫用戶端的 IP 位址。
  • io_typereadwrite
  • query_hash:查詢字串的專屬雜湊。
美國 計數器
alloydb_omni_database_postgresql_insights_perquery_lock_time_us_total 每位使用者、每個資料庫和每項查詢的累計鎖定等待時間。
  • querystring:正規化查詢。
  • user:資料庫使用者。
  • client_addr:資料庫用戶端的 IP 位址。
  • lock_typelwhwbuffer_pin
  • query_hash:查詢字串的專屬雜湊。
美國 計數器
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_typehitmiss
  • query_hash:查詢字串的專屬雜湊。
計數器
alloydb_omni_database_postgresql_insights_pertag_execution_time_us_total 每位使用者、每個資料庫、每個標記的累計執行時間。也就是下列項目的總和:CPU 作業時間、IO 等待時間、鎖定等待時間、程序內容變更,以及查詢執行作業中的所有程序排程。
  • user:資料庫使用者。
  • client_addr:資料庫用戶端的 IP 位址。
  • action:動作名稱。
  • application:應用程式名稱。
  • controller:控制器的名稱。
  • db_driver:db_driver 的名稱。
  • framework:架構名稱。
  • route:路徑名稱。
  • tag_hash:標記字串的專屬雜湊。
美國 計數器
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_typereadwrite
  • tag_hash:標記字串的專屬雜湊。
美國 計數器
alloydb_omni_database_postgresql_insights_pertag_lock_time_us_total 每個資料庫和每個標記的每位使用者累計鎖定等待時間。
  • user:資料庫使用者。
  • client_addr:資料庫用戶端的 IP 位址。
  • action:動作名稱。
  • application:應用程式名稱。
  • controller:控制器的名稱。
  • db_driver:db_driver 的名稱。
  • framework:架構名稱。
  • route:路徑名稱。
  • lock_typelwhwbuffer_pin
  • tag_hash:標記字串的專屬雜湊。
美國 計數器
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_typehitmiss
  • 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 指標處理常式遇到的內部錯誤總數。 錯誤原因 計數器

控制器執行階段指標

AlloyDB Omni 會公開這些指標,方便您監控健康狀態和效能。詳情請參閱「controller-runtime 指標參考資料」。

名稱 說明 標籤 單位 類型
workqueue_depth 工作佇列目前的深度。 名稱 度量圖
workqueue_adds_total 工作佇列處理的加入總數。 名稱 計數器
workqueue_queue_duration_seconds 項目在工作佇列中停留多久 (以秒為單位),才會遭到要求。 名稱 直方圖
workqueue_work_duration_seconds 處理工作佇列中的項目需要多少秒。 名稱 直方圖
workqueue_unfinished_work_seconds work_duration 尚未觀察到正在進行的工作,已完成的工作時間長度 (以秒為單位)。值越大表示執行緒卡住。觀察這個值增加的速度,即可推斷卡住的執行緒數量。 名稱 度量圖
workqueue_longest_running_processor_seconds 工作佇列中執行時間最長的處理器已執行多少秒。 名稱 度量圖
workqueue_retries_total 工作佇列處理的重試總次數。 名稱 計數器
rest_client_requests_total HTTP 要求數量,依狀態碼、方法和主機分割。 代碼、方法、主機 計數器
controller_runtime_reconcile_total 每個控制器可進行的對帳總次數。 控制器、結果 計數器
controller_runtime_reconcile_errors_total 每個控制器發生對帳錯誤的總數。 控制器 計數器
controller_runtime_terminal_reconcile_errors_total 調解器發生的終端錯誤總數。 控制器 計數器
controller_runtime_reconcile_time_seconds 每個控制器每次對帳的時間長度。 控制器 直方圖
controller_runtime_max_concurrent_reconciles 每個控制器可同時執行的對帳作業數量上限。 控制器 度量圖
controller_runtime_active_workers 每個控制器使用的工作站數量。 控制器 控制器 度量圖
controller_runtime_webhook_latency_seconds 處理許可要求延遲時間的直方圖。 Webhook 直方圖
controller_runtime_webhook_requests_total 依 HTTP 狀態碼劃分的許可要求總數。 webhook、程式碼 計數器
controller_runtime_webhook_requests_in_flight 目前處理中的准入要求數量。 Webhook 度量圖

後續步驟