Skip to content

Commit 7ce8c22

Browse files
authored
[DENG-8890] Add BI engine information to monitoring.jobs_by_organization and monitoring.bigquery_usage (#8242)
1 parent c8aa6f8 commit 7ce8c22

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

sql/moz-fx-data-shared-prod/monitoring_derived/bigquery_usage_v2/query.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ WITH jobs_by_org AS (
2828
error_result.reason AS error_reason,
2929
error_result.message AS error_message,
3030
query_info_resource_warning AS resource_warning,
31+
bi_engine_mode,
32+
acceleration_mode,
33+
bi_engine_reasons
3134
FROM
3235
`moz-fx-data-shared-prod.monitoring_derived.jobs_by_organization_v1` AS jobs
3336
LEFT JOIN
@@ -89,6 +92,9 @@ SELECT DISTINCT
8992
@submission_date AS submission_date,
9093
jp.labels,
9194
jp.is_materialized_view_refresh,
95+
jo.bi_engine_mode,
96+
jo.acceleration_mode,
97+
jo.bi_engine_reasons,
9298
FROM
9399
jobs_by_org AS jo
94100
LEFT JOIN

sql/moz-fx-data-shared-prod/monitoring_derived/bigquery_usage_v2/schema.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,27 @@ fields:
148148
name: is_materialized_view_refresh
149149
type: BOOLEAN
150150
description: Whether or not the query is a materialized view refresh, based on the query string.
151+
152+
- mode: NULLABLE
153+
name: bi_engine_mode
154+
type: STRING
155+
description: High-level BI Engine status for the job (e.g., ENABLED, DISABLED, PARTIAL).
156+
157+
- mode: NULLABLE
158+
name: acceleration_mode
159+
type: STRING
160+
description: How BI Engine was used when acceleration occurred (e.g., FULL_QUERY, FULL_INPUT, PARTIAL_INPUT).
161+
162+
- mode: REPEATED
163+
name: bi_engine_reasons
164+
type: RECORD
165+
description: Reasons explaining why BI Engine was PARTIAL or DISABLED for this job.
166+
fields:
167+
- mode: NULLABLE
168+
name: code
169+
type: STRING
170+
description: Machine-readable reason code.
171+
- mode: NULLABLE
172+
name: message
173+
type: STRING
174+
description: Human-readable explanation of the reason.

sql/moz-fx-data-shared-prod/monitoring_derived/jobs_by_organization_v1/query.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ def create_query(job_date: date, project: str):
6262
DATE(creation_time) as creation_date,
6363
materialized_view_statistics,
6464
query_dialect,
65+
bi_engine_statistics.bi_engine_mode AS bi_engine_mode,
66+
bi_engine_statistics.acceleration_mode AS acceleration_mode,
67+
bi_engine_statistics.bi_engine_reasons AS bi_engine_reasons,
6568
FROM
6669
`{project}.region-us.INFORMATION_SCHEMA.JOBS_BY_ORGANIZATION`
6770
WHERE

sql/moz-fx-data-shared-prod/monitoring_derived/jobs_by_organization_v1/schema.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,27 @@ fields:
222222
name: query_dialect
223223
type: STRING
224224
description: The query dialect used for the job.
225+
226+
- mode: NULLABLE
227+
name: bi_engine_mode
228+
type: STRING
229+
description: High-level BI Engine status for the job (e.g., ENABLED, DISABLED, PARTIAL).
230+
231+
- mode: NULLABLE
232+
name: acceleration_mode
233+
type: STRING
234+
description: How BI Engine was used when acceleration occurred (e.g., FULL_QUERY, FULL_INPUT, PARTIAL_INPUT).
235+
236+
- mode: REPEATED
237+
name: bi_engine_reasons
238+
type: RECORD
239+
description: Reasons explaining why BI Engine was PARTIAL or DISABLED for this job.
240+
fields:
241+
- mode: NULLABLE
242+
name: code
243+
type: STRING
244+
description: Machine-readable reason code.
245+
- mode: NULLABLE
246+
name: message
247+
type: STRING
248+
description: Human-readable explanation of the reason.

0 commit comments

Comments
 (0)