本文說明區域 API 的配額指標,以及各項指標的限制。本文也會說明如何更新 Cloud Monitoring 資訊主頁、快訊政策和查詢,以使用區域指標。
區域 API 配額指標
使用全球配額指標的 Compute Engine 地區 API 會改用地區指標。全域 API 會繼續使用全域指標和配額限制。請參閱「全球指標的 API 使用頻率限制」。
如要進一步瞭解使用區域指標的方法和限制,請參閱「區域指標的 API 使用頻率限制」。
下表列出從全域 API 配額指標遷移至區域指標的所有指標:
全域 API 配額指標 | 區域 API 配額指標 |
---|---|
compute.googleapis.com/default |
compute.googleapis.com/default_per_region |
compute.googleapis.com/read_requests |
compute.googleapis.com/read_requests_per_region |
compute.googleapis.com/list_requests |
compute.googleapis.com/list_requests_per_region |
compute.googleapis.com/operation_read_requests |
compute.googleapis.com/operation_read_requests_per_region |
compute.googleapis.com/heavy_weight_read_requests |
compute.googleapis.com/heavy_weight_read_requests_per_region |
compute.googleapis.com/heavy_weight_write_requests |
compute.googleapis.com/heavy_weight_write_requests_per_region |
compute.googleapis.com/global_resource_write_requests |
compute.googleapis.com/global_resource_write_requests_per_region |
下列指標沒有任何全域 API。如果您在 Cloud Monitoring 資訊主頁、快訊或查詢中參照這些指標,必須將這些指標遷移至對應的區域指標。
全域 API 配額指標 | 區域 API 配額指標 |
---|---|
compute.googleapis.com/simulate_maintenance_event_requests |
compute.googleapis.com/simulate_maintenance_event_requests_per_region |
compute.googleapis.com/instance_list_referrers_requests |
compute.googleapis.com/instance_list_referrers_requests_per_region |
compute.googleapis.com/get_serial_port_output_requests |
compute.googleapis.com/get_serial_port_output_requests_per_region |
compute.googleapis.com/network_endpoint_write_requests |
compute.googleapis.com/network_endpoint_write_requests_per_region |
compute.googleapis.com/network_endpoint_list_requests |
compute.googleapis.com/network_endpoint_list_requests_per_region |
下列指標沒有任何區域或可用區 API。因此,遷移區域 API 配額時不需要進行任何變更。
compute.googleapis.com/project_set_common_instance_metadata_requests
compute.googleapis.com/license_insert_requests
遷移 Cloud Monitoring 指標
從現有 API 配額指標遷移至區域 API 配額指標時,您必須手動更新 Cloud Monitoring 資訊主頁、快訊和查詢,才能使用區域指標。
更新 Cloud Monitoring 資訊主頁,改用區域指標
如要將監控全域 API 配額指標的快訊政策變更為監控區域指標,請按照下列步驟操作:
- 在 Google Cloud 控制台中選取「Monitoring」。
- 在導覽窗格中,選取「Dashboards」(資訊主頁)。
- 選取要編輯的資訊主頁,以便使用區域指標。
- 按一下「編輯資訊主頁」。
編輯與要遷移的指標相應的篩選器:
- 在「篩選器」欄位中,選取「
quota_metric
」。 - 在「Comparator」(比較子) 欄位中,選取
=~
。 在「Value」(值) 欄位中,指定區域 API 配額的指標名稱。 舉例來說,篩選器
quota_metric =~ compute.googleapis.com/read_requests.*
會使用規則運算式,比對所有使用配額指標compute.googleapis.com/read_requests.*
的時間序列資料。如要進一步瞭解指標,請參閱「區域指標的 API 使用頻率限制」。
按一下「完成」儲存變更。
選用步驟:如要查看各區域的配額用量,請展開「已分組」標題,然後在「分組依據」欄位中選取
location
。
- 在「篩選器」欄位中,選取「
按一下「Close editor」(關閉編輯器)。
更新 Cloud Monitoring 快訊政策,改用區域 API 配額指標
如要將監控全域 API 配額指標的快訊政策變更為監控區域指標,請按照下列步驟操作:
- 在 Google Cloud 控制台中選取「Monitoring」。
- 在導覽窗格中,選取「快訊」。 「警告」頁面會顯示窗格,列出摘要資訊、事件和警告政策。
- 按一下要編輯的快訊政策,以使用區域指標。
- 按一下「編輯」修改政策。
編輯與要遷移的指標相應的篩選器:
- 在「篩選器」欄位中,選取「
quota_metric
」。 - 在「Comparator」(比較子) 欄位中,選取
=~
。 在「Value」(值) 欄位中,指定區域 API 配額的指標名稱。 舉例來說,篩選器
quota_metric =~ compute.googleapis.com/read_requests.*
會使用規則運算式,比對所有使用配額指標compute.googleapis.com/read_requests.*
的時間序列資料。如要進一步瞭解指標,請參閱「區域指標的 API 使用頻率限制」。
按一下「完成」,儲存篩選器的變更。
選用:如要針對區域指標設定每個區域的快訊,請展開「跨時間序列」標題,然後在「時間序列分組依據」欄位中選取
location
。
- 在「篩選器」欄位中,選取「
按一下 [Save Policy] (儲存政策)。
更新 Cloud Monitoring 查詢,以使用區域配額指標
如要變更以 MQL 為基礎的快訊政策或資訊主頁圖表中的配額指標,請使用查詢編輯器編輯查詢篩選器。請參閱「使用查詢編輯器」。
開啟查詢編輯器,並編輯查詢指標的篩選器,如下列範例所示:
(選用) 您可以使用 group-by
作業,依據位置將快訊分組: