Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hubble-435] Add DAG for dbt monitoring models #432

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion airflow_variables_dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"partnership_assets__account_holders_activity_fact": false,
"partnership_assets__asset_activity_fact": false
},
"dbt_image_name": "stellar/stellar-dbt:1a777f9",
"dbt_image_name": "stellar/stellar-dbt:5c7c924",
"dbt_internal_source_db": "test-hubble-319619",
"dbt_internal_source_schema": "test_crypto_stellar_internal",
"dbt_job_execution_timeout_seconds": 300,
Expand Down Expand Up @@ -359,6 +359,7 @@
"liquidity_pools_value_history": 600,
"liquidity_providers": 720,
"mgi": 660,
"monitoring_packages": 720,
"network_stats": 720,
"ohlc": 720,
"partnership_assets": 660,
Expand Down
3 changes: 2 additions & 1 deletion airflow_variables_prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"partnership_assets__asset_activity_fact": false,
"trade_agg": false
},
"dbt_image_name": "stellar/stellar-dbt:1a777f9",
"dbt_image_name": "stellar/stellar-dbt:5c7c924",
"dbt_internal_source_db": "hubble-261722",
"dbt_internal_source_schema": "crypto_stellar_internal_2",
"dbt_job_execution_timeout_seconds": 1800,
Expand Down Expand Up @@ -357,6 +357,7 @@
"liquidity_pools_value_history": 360,
"liquidity_providers": 720,
"mgi": 1020,
"monitoring_packages": 720,
"network_stats": 360,
"ohlc": 960,
"partnership_assets": 1380,
Expand Down
33 changes: 33 additions & 0 deletions dags/dbt_monitoring_packages_dag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from datetime import datetime

from airflow import DAG
from airflow.operators.empty import EmptyOperator
from kubernetes.client import models as k8s
from stellar_etl_airflow.build_dbt_task import dbt_task
from stellar_etl_airflow.default import get_default_dag_args, init_sentry

init_sentry()

with DAG(
"dbt_monitoring_packages",
default_args=get_default_dag_args(),
start_date=datetime(2024, 7, 3, 0, 0),
description="This DAG runs dbt build related to data observability and monitoring tag",
schedule="0 8 * * *",
user_defined_filters={
"container_resources": lambda s: k8s.V1ResourceRequirements(requests=s),
},
max_active_runs=1,
catchup=False,
tags=["monitoring"],
) as dag:

# DBT tests to run
monitoring_task = dbt_task(
dag,
tag="monitoring_packages",
)
start_task = EmptyOperator(task_id="start_monitoring_task")

# DAG task graph
start_task >> monitoring_task
Loading