本文說明如何從 BigQuery Studio 查詢追蹤資料。使用 BigQuery Studio 時,您可以將追蹤資料與其他業務資料合併。
如要開始使用 Observability Analytics,請參閱「查詢及分析追蹤記錄」。
事前準備
- 登入 Google Cloud 帳戶。如果您是 Google Cloud新手,歡迎 建立帳戶,親自評估產品在實際工作環境中的成效。新客戶還能獲得價值 $300 美元的免費抵免額,可用於執行、測試及部署工作負載。
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
如要取得從 BigQuery 查詢連結資料集所需的權限,請要求管理員授予您下列 IAM 角色:
- 在要查詢的觀測檢視畫面中,選取「觀測檢視畫面存取者」 (
roles/observability.viewAccessor)。這個角色支援 IAM 條件,可讓您將授權限制在特定檢視區塊。如果未將條件附加至角色授予作業,主體就能存取所有可觀測性檢視畫面。 - 專案或連結的 BigQuery 資料集的 BigQuery 資料檢視者 (
roles/bigquery.dataViewer)
如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和組織的存取權」。
- 在要查詢的觀測檢視畫面中,選取「觀測檢視畫面存取者」 (
- 確認您在儲存追蹤資料的可觀測性資料集上,有連結的 BigQuery 資料集。如果連結的 BigQuery 資料集不存在,請建立該資料集。
在 BigQuery Studio 執行查詢
如要從「可觀測性分析」頁面開啟 BigQuery,然後查詢追蹤資料,請按照下列步驟操作:
-
在 Google Cloud 控制台中,前往 manage_search「Observability Analytics」(觀測能力分析) 頁面:
前往「Observability Analytics」(觀測能力分析) 頁面
如果您是使用搜尋列尋找這個頁面,請選取子標題為「Logging」的結果。
輸入或載入查詢。詳情請參閱「查詢及分析追蹤記錄」。
在工具列中,展開標示為「執行查詢」或「在 BigQuery 中執行」的選單,然後選取「在 BigQuery 中開啟」。
BigQuery Studio 隨即開啟。在本頁面中,
FROM陳述式會使用 BigQuery Table 路徑語法指定連結的資料集。您可以對查詢執行任何支援的動作,例如編輯查詢。如果「在 BigQuery 中開啟」選項已停用,表示沒有已連結的資料集,或是您沒有必要的權限,無法在 BigQuery 中開啟及查看查詢。
在 BigQuery Studio 中,按一下「執行查詢」。
定價
如要瞭解使用 BigQuery 的相關費用,請參閱 BigQuery 定價。