您可以通过查看 INFORMATION_SCHEMA.JOBS 视图来跟踪 BigQuery 使用了哪些 Looker Studio 报告和数据源。BigQuery 中的每个 Looker Studio 查询都会创建一个带有 report_id 和 datasource_id 标签的条目。打开报告或数据源页面时,这些 ID 会显示在 Looker Studio 网址的末尾。例如,网址为 https://lookerstudio.google.com/navigation/reporting/my-report-id-123 的报告的 ID 为 "my-report-id-123"。
以下示例展示了如何查看报告和数据源:
查找每个 Looker Studio BigQuery 作业的报告和数据源网址
-- Standard labels used by Looker Studio.DECLARErequestor_keySTRINGDEFAULT'requestor';DECLARErequestor_valueSTRINGDEFAULT'looker_studio';CREATETEMPFUNCTIONGetLabel(labelsANYTYPE,label_keySTRING)AS((SELECTl.valueFROMUNNEST(labels)lWHEREl.key=label_key));CREATETEMPFUNCTIONGetDatasourceUrl(labelsANYTYPE)AS(CONCAT("https://lookerstudio.google.com/datasources/",GetLabel(labels,'looker_studio_datasource_id')));CREATETEMPFUNCTIONGetReportUrl(labelsANYTYPE)AS(CONCAT("https://lookerstudio.google.com/reporting/",GetLabel(labels,'looker_studio_report_id')));SELECTjob_id,GetDatasourceUrl(labels)ASdatasource_url,GetReportUrl(labels)ASreport_url,FROM`region-us`.INFORMATION_SCHEMA.JOBSjobsWHEREcreation_time>TIMESTAMP_SUB(CURRENT_TIMESTAMP(),INTERVAL7DAY)ANDGetLabel(labels,requestor_key)=requestor_valueLIMIT100;
查看使用报告和数据源生成的作业
-- Specify report and data source id, which can be found at the end of Looker Studio URLs.DECLAREuser_report_idSTRINGDEFAULT'*report id here*';DECLAREuser_datasource_idSTRINGDEFAULT'*datasource id here*';-- Looker Studio labels for BigQuery.DECLARErequestor_keySTRINGDEFAULT'requestor';DECLARErequestor_valueSTRINGDEFAULT'looker_studio';DECLAREdatasource_keySTRINGDEFAULT'looker_studio_datasource_id';DECLAREreport_keySTRINGDEFAULT'looker_studio_report_id';CREATETEMPFUNCTIONGetLabel(labelsANYTYPE,label_keySTRING)AS((SELECTl.valueFROMUNNEST(labels)lWHEREl.key=label_key));SELECTcreation_time,job_id,FROM`region-us`.INFORMATION_SCHEMA.JOBSjobsWHEREcreation_time>TIMESTAMP_SUB(CURRENT_TIMESTAMP(),INTERVAL7DAY)ANDGetLabel(labels,requestor_key)=requestor_valueANDGetLabel(labels,datasource_key)=user_datasource_idANDGetLabel(labels,report_key)=user_report_idORDERBY1LIMIT100;
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-17。"],[[["\u003cp\u003eBigQuery BI Engine acceleration can be monitored using \u003ccode\u003eINFORMATION_SCHEMA\u003c/code\u003e and Cloud Monitoring metrics, with the latter allowing for the creation of custom dashboards and alerts for BI Engine.\u003c/p\u003e\n"],["\u003cp\u003eBI Engine query acceleration has four modes: \u003ccode\u003eBI_ENGINE_DISABLED\u003c/code\u003e, \u003ccode\u003ePARTIAL_INPUT\u003c/code\u003e, \u003ccode\u003eFULL_INPUT\u003c/code\u003e, and \u003ccode\u003eFULL_QUERY\u003c/code\u003e, each indicating the extent to which BI Engine is involved in query processing.\u003c/p\u003e\n"],["\u003cp\u003eDetailed BI Engine statistics, including acceleration modes and reasons for non-acceleration, are available through the BigQuery API via the \u003ccode\u003ebiEngineStatistics\u003c/code\u003e field and in the \u003ccode\u003eINFORMATION_SCHEMA.JOBS_BY_*\u003c/code\u003e views.\u003c/p\u003e\n"],["\u003cp\u003eLooker Studio usage with BigQuery can be tracked via \u003ccode\u003eINFORMATION_SCHEMA.JOBS\u003c/code\u003e, with specific report and data source IDs found at the end of the Looker Studio URLs, allowing for the monitoring of report and data source usage.\u003c/p\u003e\n"],["\u003cp\u003eCloud Monitoring provides specific metrics for BigQuery BI Engine, such as Reservation Total Bytes, Reservation Used Bytes, and BI Engine Top Tables Cached Bytes, and BI Engine related activity can also be inspected in Cloud logging.\u003c/p\u003e\n"]]],[],null,["# Monitor BI Engine\n=================\n\n[BigQuery BI Engine](/bigquery/docs/bi-engine-intro) accelerates\nBigQuery for BI scenarios using memory cache and faster execution.\nAcceleration details can be monitored using\n[INFORMATION_SCHEMA](/bigquery/docs/information-schema-jobs) and\n[Cloud Monitoring metrics](/bigquery/docs/monitoring).\n\nCloud Monitoring\n----------------\n\nYou can monitor and configure alerts for BigQuery BI Engine with\nCloud Monitoring. To learn how to create dashboard for\nBI Engine metrics, see [Creating charts](/monitoring/charts).\n\nThe following metrics are provided for BigQuery BI Engine:\n\nQuery statistics for BI Engine\n------------------------------\n\nThis section explains how to find query statistics to help monitor, diagnose,\nand troubleshoot BI Engine use.\n\n### BI Engine acceleration modes\n\nWith BI Engine acceleration enabled, your query can run in any one\nof these four modes:\n\n### View BigQuery API job statistics\n\nDetailed statistics on BI Engine are available through the\nBigQuery API.\n\nTo fetch the statistics associated with BI Engine accelerated\nqueries, run the following bq command-line tool command: \n\n bq show --format=prettyjson -j job_id\n\nIf the project is enabled for BI Engine acceleration, then the\noutput produces a new field, `biEngineStatistics`. Here is a sample job\nreport: \n\n \"statistics\": {\n \"creationTime\": \"1602175128902\",\n \"endTime\": \"1602175130700\",\n \"query\": {\n \"biEngineStatistics\": {\n \"biEngineMode\": \"DISABLED\",\n \"biEngineReasons\": [\n {\n \"code\": \"UNSUPPORTED_SQL_TEXT\",\n \"message\": \"Detected unsupported join type\"\n }\n ]\n },\n\nFor more information about the `BiEngineStatistics` field, see the\n[Job reference](/bigquery/docs/reference/rest/v2/Job#bienginestatistics).\n\n### BigQuery information schema statistics\n\nBI Engine acceleration statistics are included in the\n[BigQuery `INFORMATION_SCHEMA`](/bigquery/docs/information-schema-intro)\nviews as part of the `INFORMATION_SCHEMA.JOBS_BY_*` views in the\n[`bi_engine_statistics`](/bigquery/docs/information-schema-jobs#schema) column.\nFor example, this query returns the `bi_engine_statistics` for all of the\ncurrent projects' jobs for the last 24 hours: \n\n SELECT\n creation_time,\n job_id,\n bi_engine_statistics\n FROM\n `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT\n WHERE\n creation_time \u003e\n TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 DAY)\n AND job_type = \"QUERY\"\n\nUse the following format to specify\n[regionality](/bigquery/docs/information-schema-views#scope_and_syntax) for the\n`project-id`, `region`, and `views` in the `INFORMATION_SCHEMA` view: \n\n```bash\n`PROJECT_ID`.`region-REGION_NAME`.INFORMATION_SCHEMA.VIEW\n```\n\n\u003cbr /\u003e\n\n| **Logging slot metrics:** Although slot metrics for BI Engine are reported, accelerated BI Engine input stages are not counted towards slot reservations. See the [pricing](/bi-engine/pricing#example_of_slotm_metrics) page on how to interpret the slotMs and totalSlotMs metrics when you have BI Engine-accelerated queries.\n\n### View Looker Studio information schema details\n\nYou can track which Looker Studio reports and data sources are\nused by BigQuery by viewing the [`INFORMATION_SCHEMA.JOBS`\nview](/bigquery/docs/information-schema-jobs). Every\nLooker Studio query in BigQuery creates an entry\nwith `report_id` and `datasource_id` labels. Those IDs appear at the end of\nLooker Studio URL when opening a report or data source page.\nFor example, a report with URL\n`https://lookerstudio.google.com/navigation/reporting/my-report-id-123` has a\nreport ID of `\"my-report-id-123\"`.\n\nThe following examples show how to view reports and data sources:\n\n#### Find report and data source URL for each Looker Studio BigQuery job\n\n```googlesql\n-- Standard labels used by Looker Studio.\nDECLARE requestor_key STRING DEFAULT 'requestor';\nDECLARE requestor_value STRING DEFAULT 'looker_studio';\n\nCREATE TEMP FUNCTION GetLabel(labels ANY TYPE, label_key STRING)\nAS (\n (SELECT l.value FROM UNNEST(labels) l WHERE l.key = label_key)\n);\n\nCREATE TEMP FUNCTION GetDatasourceUrl(labels ANY TYPE)\nAS (\n CONCAT(\"https://lookerstudio.google.com/datasources/\", GetLabel(labels, 'looker_studio_datasource_id'))\n);\n\nCREATE TEMP FUNCTION GetReportUrl(labels ANY TYPE)\nAS (\n CONCAT(\"https://lookerstudio.google.com/reporting/\", GetLabel(labels, 'looker_studio_report_id'))\n);\n\nSELECT\n job_id,\n GetDatasourceUrl(labels) AS datasource_url,\n GetReportUrl(labels) AS report_url,\nFROM\n `region-us`.INFORMATION_SCHEMA.JOBS jobs\nWHERE\n creation_time \u003e TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)\n AND GetLabel(labels, requestor_key) = requestor_value\nLIMIT\n 100;\n```\n\n#### View jobs produced by using a report and data source\n\n```googlesql\n-- Specify report and data source id, which can be found at the end of Looker Studio URLs.\nDECLARE user_report_id STRING DEFAULT '*report id here*';\nDECLARE user_datasource_id STRING DEFAULT '*datasource id here*';\n\n-- Looker Studio labels for BigQuery.\nDECLARE requestor_key STRING DEFAULT 'requestor';\nDECLARE requestor_value STRING DEFAULT 'looker_studio';\nDECLARE datasource_key STRING DEFAULT 'looker_studio_datasource_id';\nDECLARE report_key STRING DEFAULT 'looker_studio_report_id';\n\nCREATE TEMP FUNCTION GetLabel(labels ANY TYPE, label_key STRING)\nAS (\n (SELECT l.value FROM UNNEST(labels) l WHERE l.key = label_key)\n);\n\nSELECT\n creation_time,\n job_id,\nFROM\n `region-us`.INFORMATION_SCHEMA.JOBS jobs\nWHERE\n creation_time \u003e TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)\n AND GetLabel(labels, requestor_key) = requestor_value\n AND GetLabel(labels, datasource_key) = user_datasource_id\n AND GetLabel(labels, report_key) = user_report_id\nORDER BY 1\nLIMIT 100;\n```\n\nCloud Logging\n-------------\n\nBI Engine acceleration is part of BigQuery job\nprocessing. To inspect BigQuery jobs for a specific project,\nsee the [Cloud Logging](https://console.cloud.google.com/logs/query) page with a payload of\n`protoPayload.serviceName=\"bigquery.googleapis.com\"`.\n\nWhat's next\n-----------\n\n- Learn more about [Cloud Monitoring](/monitoring/docs).\n- Learn more about Monitoring [charts](/monitoring/charts).\n- Learn more about Monitoring [alerts](/monitoring/alerts).\n- Learn more about [Cloud Logging](/logging/docs)."]]