查看及自訂 VM 資訊主頁
完成下列任務,瞭解如何查看及自訂 Compute Engine 虛擬機器 (VM) 執行個體的資訊主頁:
- 建立 Compute Engine VM 執行個體。
- 查看預設資訊主頁。
- 自訂預設資訊主頁。
- 清除所用資源。
如要直接在 Google Cloud 控制台按照逐步指南操作,請按一下「Guide me」(逐步引導):
事前準備
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Compute Engine and Cloud Monitoring APIs.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Compute Engine and Cloud Monitoring APIs.
-
前往 Google Cloud 控制台的「VM instances」(VM 執行個體) 頁面:
如果您是使用搜尋列尋找這個頁面,請選取子標題為「Compute Engine」的結果。
- 點選「Create instance」(建立執行個體) 建立 VM。使用導覽選單中的選項,設定執行個體。
- 在「Machine configuration」(機器設定) 選項中,執行下列操作:
- 在「Name」(名稱) 欄位輸入描述性名稱。
- 在「Machine type」(機型) 預設下拉式選單,依序選取「Shared-core」(共用核心) >「e2-small」。
- 確認「OS and storage」(OS 與儲存空間) 選項顯示「Debian GNU/Linux」。如果沒有,請依序點選「OS and storage」(OS 與儲存空間) 和「Change」(變更)。在「Boot disk」(開機磁碟) 對話方塊中,將「Version」(版本) 設為「Debian GNU/Linux」。
- 按一下 [建立]。
-
前往 Google Cloud 控制台的「VM instances」(VM 執行個體) 頁面:
如果您是使用搜尋列尋找這個頁面,請選取子標題為「Compute Engine」的結果。
- 在「VM instances」(VM 執行個體) 頁面中,按一下執行個體名稱。
選取「Observability」(觀測能力) 分頁標籤。
如有建立 VM,可能需要過幾分鐘後,圖表才會顯示資料。
查看「Observability」(觀測能力) 分頁中的圖表。
- 在「Observability」(觀測能力) 工具列中,按一下「Save as dashboard」(儲存為資訊主頁)。
- 點選「Submit」(提交)。
按一下「View in Monitoring」(在 Monitoring 中查看)。
您現在正在查看可自訂的資訊主頁。這個資訊主頁是由 Cloud Monitoring 管理。
如要新增小工具,請按一下「Add widget」(新增小工具) 並完成對話方塊。 舉例來說,如要查看含有指標資料的記錄檔,請按一下「Add widget」(新增小工具),選取「Logs」(記錄檔),然後按一下「Apply」(套用)。
如要移除或修改小工具,請使用小工具工具列中的選項。
如要調整小工具的位置或大小,請使用指標。
如果您修改了副本,請按一下「Save」(儲存)。
在導覽窗格中,選取「Dashboards」(資訊主頁)。
在「My Dashboards」(我的資訊主頁) 窗格,您會看到新的資訊主頁列於其中。
-
在 Google Cloud 控制台中,前往「Dashboards」(資訊主頁)
頁面:
如果您是使用搜尋列尋找這個頁面,請選取子標題為「Monitoring」的結果。
如要查看執行個體專屬資訊主頁,請在「My Dashboards」(我的資訊主頁) 窗格中按一下「VM instances」(VM 執行個體)。
「VM instances」(VM 執行個體) 頁面會列出您的 VM,並包含 VM 專屬資訊主頁的連結。這些資訊主頁是由 Cloud Monitoring 建立及代管。
如要查看所有 VM 的指標,請在導覽窗格中依序選取「Dashboards」(資訊主頁) 和「GCE VM Instance Monitoring」(GCE VM 執行個體監控) 資訊主頁。
如要建立這個資訊主頁的可編輯副本,請按一下「Copy Dashboard」(複製資訊主頁)。
建立 VM 執行個體
如果您還沒有 VM 執行個體,請先建立:
查看 VM 的觀測能力資訊主頁
觀測能力資訊主頁會顯示使用率指標、處理量指標,以及記錄相關資料:
建立自訂觀測能力資訊主頁
如要建立可編輯的觀測能力資訊主頁副本,請按照下列步驟操作:
您已成功自訂 Compute Engine VM 執行個體的觀測能力資訊主頁。您可以按照同樣的程序,為許多其他 Google Cloud 資源自訂資訊主頁。
查看 Monitoring 建立的 VM 資訊主頁
Cloud Monitoring 會建立及管理多個資訊主頁,用於顯示 VM 執行個體的指標。您可以透過 Cloud Monitoring 的「Dashboards」頁面存取這些資訊主頁:
清除所用資源
如要避免系統向您的 Google Cloud 帳戶收取您在本頁所用資源的費用,請按照下列步驟操作。
如果您建立新專案,但現在已不再需要該專案,請刪除專案。
如果您使用的是現有專案,請執行下列操作:
如果您已建立 VM,請刪除該 VM:
- In the Google Cloud console, go to the VM instances page.
- Select the checkbox for the instance that you want to delete.
- To delete the instance, click More actions, click Delete, and then follow the instructions.
刪除您建立的資訊主頁:
-
在 Google Cloud 控制台中,前往「Dashboards」(資訊主頁)
頁面:
如果您是使用搜尋列尋找這個頁面,請選取子標題為「Monitoring」的結果。
- 找到您建立的資訊主頁,然後按一下
「Delete」(刪除) 。
-
後續步驟
如要瞭解如何安裝作業套件代理程式,並從 Apache 伺服器收集指標,請參閱「透過作業套件代理程式收集 Apache 指標」快速入門指南。
如要瞭解如何測試網址是否回應要求,以及模擬失敗情況,請參閱快速入門導覽課程「在應用程式停止回應時接收通知」。
如要瞭解如何測試應用程式,請參閱「綜合監控功能總覽」。
如要瞭解作業套件代理程式,請參閱「作業套件代理程式總覽」。
如要瞭解如何建立自訂資訊主頁,請參閱「管理自訂資訊主頁」。