측정항목 탐색기가 탐색 메뉴에 표시되었으면 이를 선택합니다.
아니면 리소스를 클릭한 다음 측정항목 탐색기를 선택합니다.
페이지 상단에서 시간 간격을 선택합니다.
측정항목 드롭다운 목록의 리소스 또는 측정항목 이름으로 필터링 필드에 spanner를 입력하고 Enter를 눌러 검색 범위를 좁힙니다.
측정항목 선택 목록에서 Cloud Spanner 인스턴스 > 인스턴스 > 처리 단위 초를 선택한 후 적용을 클릭합니다.
이렇게 하면 모든 Spanner 인스턴스의 합산 Data Boost 사용량 선 차트가 생성됩니다.
특정 인스턴스의 사용량을 보려면 다음 단계를 따릅니다.
필터 필드를 사용하여 인스턴스 ID와 같은 필터를 추가합니다.
+를 클릭하여 다른 속성을 추가합니다.
모든 인스턴스별 사용량 분류를 보려면 다음 단계를 따르세요.
필터 필드 옆에 있는 X 아이콘을 클릭하여 필터를 지웁니다.
집계 연산자 드롭다운 목록에서 합계를 선택한 다음 instance_id를 기준으로 선택합니다.
주 구성원별로 사용량을 분류하려면 집계 연산자 드롭다운에서 Sum을 선택한 다음 credential_id를 선택합니다.
감사 로그를 사용하여 Data Boost 사용량 분석
Spanner 감사 로그를 사용하면 Data Boost 사용량을 더욱 유연하게 분석할 수 있습니다. Cloud Monitoring에서와 같이 인스턴스 또는 주 구성원별로 시간 경과에 따른 사용량을 분류하는 기능 외에도 Spanner 감사 로그가 사용 설정되어 있어 사용할 수 있는 경우 Spanner 감사 로그에서 데이터베이스 또는 BigQuery 작업 ID별로 시간 경과에 따른 사용량을 분류할 수 있습니다.
SELECTSUM(CAST(JSON_VALUE(labels.data_boost_usage)ASINT64))ASusage,REGEXP_EXTRACT(proto_payload.audit_log.resource_name,'projects/[^/]+/instances/[^/]+/databases/[^/]+')ASdatabase,proto_payload.audit_log.authentication_info.principal_emailASprincipal_email,IFNULL(JSON_VALUE(labels.data_boost_workload_id),'not from BQ')ASjob_idFROM`PROJECT_NAME.global._Default._AllLogs`WHEREtimestamp > TIMESTAMP_SUB(CURRENT_TIMESTAMP(),INTERVAL7DAY)ANDresource.type='spanner_instance'ANDoperation.lastISNULLANDJSON_VALUE(labels.data_boost_usage)!=''GROUPBYdatabase,principal_email,job_id;
PROJECT_NAME을 프로젝트 이름으로 바꿉니다.
다음 예시는 BigQuery 작업 ID별 사용량을 보여줍니다.
BigQuery SQL 텍스트별 사용량 보기
여러 BigQuery 작업의 SQL 텍스트로 집계된 해당 BigQuery 작업의 Data Boost 사용량을 보려면 다음 단계를 따르세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(UTC)"],[],[],null,["# Monitor Data Boost usage\n\n\u003cbr /\u003e\n\nThis page describes how to use Cloud Monitoring and Spanner audit\nlogs to monitor and analyze Spanner Data Boost usage.\n\nCloud Monitoring provides the ability to track total usage over time and to\nbreak down that usage by user. Spanner audit logs allow more\nflexible usage analysis, including providing metrics by user or by\nBigQuery job ID.\n\nUse Cloud Monitoring to track Data Boost usage\n----------------------------------------------\n\nFollow these steps to track overall Data Boost usage:\n\n1. In the Google Cloud console, go to **Monitoring** . \n [Go to Monitoring](https://console.cloud.google.com/monitoring)\n2. If **Metrics Explorer** is shown in the navigation menu, select it. Otherwise, click **Resources** , and then select **Metrics Explorer**.\n3. At the top of the page, select a time interval.\n4. In the **Metric** drop-down list, in the **Filter by resource or metric\n name** field, enter `spanner` and press `Enter` to narrow the search.\n5. In the **Metric** list, select **Cloud Spanner Instance \\\u003e Instance \\\u003e\n Processing unit second** , and then click **Apply**.\n\n This creates a line chart of aggregate Data Boost usage across\n all Spanner instances.\n6. To view usage for a particular instance, follow these steps:\n\n 1. Use the **Filter** field to add filters, such as the instance ID.\n 2. Click **+** to add other attributes.\n7. To view a breakdown of usage by all instances, follow these steps:\n\n 1. Clear any filters by clicking the **X** icon next to the filter fields.\n 2. In the **Aggregation** operator drop-down list, select **Sum** , and then select by **instance_id**.\n8. To break down usage by principal, in the **Aggregation** operator drop-down,\n select **Sum** , and then select by **credential_id**.\n\nUse audit logs to analyze Data Boost usage\n------------------------------------------\n\nSpanner audit logs allow more flexible analysis of\nData Boost usage. In addition to the ability to break down usage\nover time by instance or principal as with Cloud Monitoring,\nSpanner audit logs, if enabled and available, allow breaking down\nusage over time by database or BigQuery job ID.\n\nEnabling audit logs can incur extra charges. For information about\nLogging pricing, see\n[Google Cloud Observability pricing: Cloud Logging](https://cloud.google.com/stackdriver/pricing#logging-costs).\n\n### Enable Data Boost usage audit logs\n\nYou must enable data access audit logs for Spanner before you can\ncollect usage data for Data Boost. To do so, follow these steps:\n\n1. Follow the instructions in [Configure Data Access audit logs with the Google Cloud console](/logging/docs/audit/configure-data-access#config-console).\n2. Enable the **Data Read** log type for the **Spanner API** service.\n3. To obtain Data Boost usage by BigQuery job SQL text, ensure that that the audit logs for BigQuery are enabled as well.\n\n### View usage by principal\n\nTo query the audit logs to view Data Boost usage by user, follow\nthese steps:\n\n1. Go to the Logs Explorer in the Google Cloud console.\n\n [Go to Logs Explorer](https://console.cloud.google.com/logs)\n2. In the navigation menu, click **Log Analytics**.\n\n3. To show usage by user and database over the past 7 days, run the following\n query. To change the timespan for which usage is shown, modify the\n `timestamp` expression in the `WHERE` clause.\n\n SELECT\n SUM(CAST(JSON_VALUE(labels.data_boost_usage) AS INT64)) AS usage,\n REGEXP_EXTRACT(\n proto_payload.audit_log.resource_name,\n 'projects/[^/]+/instances/[^/]+/databases/[^/]+') AS database,\n proto_payload.audit_log.authentication_info.principal_email AS principal_email\n FROM `\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ePROJECT_NAME\u003c/span\u003e\u003c/var\u003e.global._Default._AllLogs`\n WHERE\n timestamp \u003e TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)\n AND resource.type = 'spanner_instance' AND operation.last IS NULL\n AND JSON_VALUE(labels.data_boost_usage) != ''\n GROUP BY database, principal_email;\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e with your project name.\n\nThe following example shows usage in processing units for 4 principals.\n\n### View usage by BigQuery job ID\n\nTo query the audit logs to view Data Boost usage broken down by\ndatabase, user, and BigQuery job ID, follow these steps:\n\n1. Go to the Logs Explorer in the Google Cloud console.\n\n [Go to Logs Explorer](https://console.cloud.google.com/logs)\n2. In the navigation menu, click **Log Analytics**.\n\n3. Run the following query:\n\n SELECT\n SUM(CAST(JSON_VALUE(labels.data_boost_usage) AS INT64)) AS usage,\n REGEXP_EXTRACT(\n proto_payload.audit_log.resource_name,\n 'projects/[^/]+/instances/[^/]+/databases/[^/]+') AS database,\n proto_payload.audit_log.authentication_info.principal_email AS principal_email,\n IFNULL(JSON_VALUE(labels.data_boost_workload_id), 'not from BQ') AS job_id\n FROM `\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ePROJECT_NAME\u003c/span\u003e\u003c/var\u003e.global._Default._AllLogs`\n WHERE\n timestamp \u003e TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)\n AND resource.type = 'spanner_instance' AND operation.last IS NULL\n AND JSON_VALUE(labels.data_boost_usage) != ''\n GROUP BY database, principal_email, job_id;\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e with your project name.\n\nThe following example shows usage by BigQuery job ID.\n\n### View usage by BigQuery SQL text\n\nTo view Data Boost usage for multiple BigQuery jobs\naggregated by the SQL text of those jobs, follow these steps:\n\n1. Go to the Logs Explorer in the Google Cloud console.\n\n [Go to Logs Explorer](https://console.cloud.google.com/logs)\n2. In the navigation menu, click **Log Analytics**.\n\n3. Run the following query:\n\n SELECT\n SUM(\n CAST(\n JSON_VALUE(db.labels.data_boost_usage)\n AS INT64)) AS usage,\n JSON_VALUE(\n bq.proto_payload.audit_log.metadata.jobInsertion.job.jobConfig.queryConfig.query)\n AS bq_query\n FROM\n `\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ePROJECT_NAME\u003c/span\u003e\u003c/var\u003e.global._Default._AllLogs` db,\n `\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ePROJECT_NAME\u003c/span\u003e\u003c/var\u003e.global._Default._AllLogs` bq\n WHERE\n db.timestamp \u003e TIMESTAMP_SUB(\n CURRENT_TIMESTAMP(), INTERVAL 7 DAY)\n AND db.resource.type = 'spanner_instance'\n AND JSON_VALUE(db.labels.data_boost_usage) != ''\n AND db.operation.last IS NULL\n AND bq.timestamp \u003e TIMESTAMP_SUB(\n CURRENT_TIMESTAMP(), INTERVAL 7 DAY)\n AND bq.proto_payload.audit_log.method_name\n = 'google.cloud.bigquery.v2.JobService.InsertJob'\n AND bq.resource.type = 'bigquery_project'\n AND JSON_VALUE(\n bq.proto_payload.audit_log.metadata.jobInsertion.job.jobConfig.queryConfig.query)\n IS NOT NULL\n AND JSON_VALUE(db.labels.data_boost_workload_id)\n = REGEXP_EXTRACT(bq.proto_payload.audit_log.resource_name, '[^/]*$')\n GROUP BY bq_query\n ORDER BY usage DESC\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e with your project name.\n\nThe following example shows Data Boost usage by SQL text.\n\nCreate a Data Boost alert\n-------------------------\n\nTo create an alert that is issued when Data Boost usage exceeds\na predefined threshold, see\n[Set an alert for Data Boost usage](/spanner/docs/databoost/databoost-quotas#databoost-alert).\n\nWhat's next\n-----------\n\n- Learn about Data Boost in [Data Boost overview](/spanner/docs/databoost/databoost-overview)."]]