Skip to content

Commit

Permalink
Merge branch 'mozilla:main' into bugzilla-etl-syndication
Browse files Browse the repository at this point in the history
  • Loading branch information
dklawren authored Oct 11, 2024
2 parents e016d8c + 221cd9b commit d118772
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bigquery_etl/query_scheduling/generate_airflow_dags.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ def get_dags(project_id, dags_config, sql_dir=None):
dag_collection=dag_collection,
)
)
tasks.append(bigeye_task)

if bigeye_task.monitoring_enabled:
tasks.append(bigeye_task)

if CHECKS_FILE in files:
checks_file = os.path.join(root, CHECKS_FILE)
Expand Down
5 changes: 5 additions & 0 deletions bigquery_etl/query_scheduling/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ class Task:
node_selector: Optional[Dict[str, str]] = attr.ib(None)
startup_timeout_seconds: Optional[int] = attr.ib(None)
secrets: Optional[List[Secret]] = attr.ib(None)
monitoring_enabled: Optional[bool] = attr.ib(False)

@property
def task_key(self):
Expand Down Expand Up @@ -489,6 +490,10 @@ def of_query(cls, query_file, metadata=None, dag_collection=None):
# expose secret config
task_config["secrets"] = metadata.scheduling.get("secrets", [])

# to determine if BigEye task should be generated
if metadata.monitoring:
task_config["monitoring_enabled"] = metadata.monitoring.enabled

# data processed in task should be published
if metadata.is_public_json():
task_config["public_json"] = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ scheduling:
dag_name: "bqetl_core"
depends_on_past: true
arguments: ["--date", "{{ds}}"]
monitoring:
enabled: true

0 comments on commit d118772

Please sign in to comment.