Skip to content

Commit

Permalink
Glean server knobs monitoring table (#4491)
Browse files Browse the repository at this point in the history
* Glean server knobs monitoring table

* fix code gen and skip dry-run

* Remove view creation in query
  • Loading branch information
quiiver authored and irrationalagent committed Dec 11, 2023
1 parent e860ee6 commit b0a79c1
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
1 change: 1 addition & 0 deletions bqetl_project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dry_run:
function: https://us-central1-moz-fx-data-shared-prod.cloudfunctions.net/bigquery-etl-dryrun
skip:
# Access Denied
- sql/moz-fx-data-shared-prod/monitoring_derived/glean_server_knob_experiments_v1/query.sql
- sql/moz-fx-data-shared-prod/ads/nt_visits_to_sessions_conversion_factors_daily/view.sql
- sql/moz-fx-data-shared-prod/account_ecosystem_derived/ecosystem_client_id_lookup_v1/query.sql
- sql/moz-fx-data-shared-prod/account_ecosystem_derived/desktop_clients_daily_v1/query.sql
Expand Down
13 changes: 13 additions & 0 deletions dags/bqetl_experimenter_experiments_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,16 @@
owner="ascholtz@mozilla.com",
email=["ascholtz@mozilla.com"],
)

with TaskGroup(
"monitoring__experimenter_experiments__v1_external"
) as monitoring__experimenter_experiments__v1_external:
ExternalTaskMarker(
task_id="bqetl_monitoring__wait_for_monitoring__experimenter_experiments__v1",
external_dag_id="bqetl_monitoring",
external_task_id="wait_for_monitoring__experimenter_experiments__v1",
)

monitoring__experimenter_experiments__v1_external.set_upstream(
monitoring__experimenter_experiments__v1
)
26 changes: 26 additions & 0 deletions dags/bqetl_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@
doc_md=docs,
tags=tags,
) as dag:
glean_server_knob_experiments__v1 = bigquery_etl_query(
task_id="glean_server_knob_experiments__v1",
destination_table="glean_server_knob_experiments_v1",
dataset_id="monitoring_derived",
project_id="moz-fx-data-shared-prod",
owner="wstuckey@mozilla.com",
email=["ascholtz@mozilla.com", "wstuckey@mozilla.com"],
date_partition_parameter="submission_date",
depends_on_past=False,
)

monitoring_derived__average_ping_sizes__v1 = gke_command(
task_id="monitoring_derived__average_ping_sizes__v1",
command=[
Expand Down Expand Up @@ -264,6 +275,21 @@
depends_on_past=False,
)

wait_for_monitoring__experimenter_experiments__v1 = ExternalTaskSensor(
task_id="wait_for_monitoring__experimenter_experiments__v1",
external_dag_id="bqetl_experimenter_experiments_import",
external_task_id="monitoring__experimenter_experiments__v1",
check_existence=True,
mode="reschedule",
allowed_states=ALLOWED_STATES,
failed_states=FAILED_STATES,
pool="DATA_ENG_EXTERNALTASKSENSOR",
)

glean_server_knob_experiments__v1.set_upstream(
wait_for_monitoring__experimenter_experiments__v1
)

wait_for_copy_deduplicate_all = ExternalTaskSensor(
task_id="wait_for_copy_deduplicate_all",
external_dag_id="copy_deduplicate",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
friendly_name: Glean Server Knobs
description: |-
A view on the experiment monitoring dataset of all glean server knob configs
labels:
incremental: false
public_bigquery: false
public_json: false
owners:
- wstuckey@mozilla.com
scheduling:
dag_name: bqetl_monitoring
task_name: glean_server_knob_experiments__v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
SELECT
normandy_slug AS slug,
app_name,
app_id,
start_date,
end_date,
status,
targeted_percent,
targeting,
feature.value.gleanMetricConfiguration AS glean_metric_config
FROM
`moz-fx-data-experiments.monitoring.experimenter_experiments_v1`
CROSS JOIN
UNNEST(branches) AS branch
CROSS JOIN
UNNEST(JSON_EXTRACT_ARRAY(branch.features)) AS feature
WHERE
"glean" IN UNNEST(feature_ids)
AND STRING(feature.featureId) = "glean"
AND JSON_QUERY(feature.value, "$.gleanMetricConfiguration") IS NOT NULL

0 comments on commit b0a79c1

Please sign in to comment.