-
Notifications
You must be signed in to change notification settings - Fork 19
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 444] Refactor Elementary monitoring to run every 30 min #413
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7c20aef
Updated airflow variables
edualvess a05ac4e
Changed elementary task trigger rule
edualvess 20d9c77
Adjusted dbt_task helper function to add exclude selector to dbt comm…
edualvess b4bb7e1
Removed elementary alerts tasks from dbt DAGs
edualvess f830e54
Added dbt_data_quality_alerts DAG
edualvess 1278f75
Merge branch 'master' into refactor/dbt_elementary_alerts
edualvess 5656cb7
Increased trilom version for file changes step
edualvess File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
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.build_elementary_slack_alert_task import elementary_task | ||
from stellar_etl_airflow.default import ( | ||
alert_sla_miss, | ||
get_default_dag_args, | ||
init_sentry, | ||
) | ||
|
||
init_sentry() | ||
|
||
with DAG( | ||
"dbt_data_quality_alerts", | ||
default_args=get_default_dag_args(), | ||
start_date=datetime(2024, 6, 25, 0, 0), | ||
description="This DAG runs dbt tests and Elementary alerts at a half-hourly cadence", | ||
schedule="*/15,*/45 * * * *", # Runs every 15th minute and every 45th minute | ||
user_defined_filters={ | ||
"container_resources": lambda s: k8s.V1ResourceRequirements(requests=s), | ||
}, | ||
max_active_runs=1, | ||
catchup=False, | ||
tags=["dbt-data-quality", "dbt-elementary-alerts"], | ||
# sla_miss_callback=alert_sla_miss, | ||
) as dag: | ||
|
||
# DBT tests to run | ||
singular_tests = dbt_task( | ||
dag, | ||
command_type="test", | ||
tag="singular_test", | ||
) | ||
singular_tests_elementary_alerts = elementary_task(dag, "dbt_data_quality") | ||
start_tests = EmptyOperator(task_id="start_tests_task") | ||
|
||
# DAG task graph | ||
start_tests >> singular_tests >> singular_tests_elementary_alerts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
from kubernetes.client import models as k8s | ||
from stellar_etl_airflow.build_cross_dependency_task import build_cross_deps | ||
from stellar_etl_airflow.build_dbt_task import dbt_task | ||
from stellar_etl_airflow.build_elementary_slack_alert_task import elementary_task | ||
from stellar_etl_airflow.default import ( | ||
alert_sla_miss, | ||
get_default_dag_args, | ||
|
@@ -55,8 +54,6 @@ | |
snapshot_state = dbt_task(dag, tag="snapshot_state") | ||
relevant_asset_trades = dbt_task(dag, tag="relevant_asset_trades") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question for the dbt_tasks in here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same response to the first comment, there's no need. |
||
|
||
elementary = elementary_task(dag, "dbt_stellar_marts") | ||
|
||
# DAG task graph | ||
wait_on_dbt_enriched_base_tables >> ohlc_task >> liquidity_pool_trade_volume_task | ||
|
||
|
@@ -75,18 +72,3 @@ | |
wait_on_dbt_enriched_base_tables >> soroban | ||
wait_on_dbt_enriched_base_tables >> snapshot_state | ||
wait_on_dbt_enriched_base_tables >> relevant_asset_trades | ||
|
||
mgi_task >> elementary | ||
liquidity_providers_task >> elementary | ||
liquidity_pools_values_task >> elementary | ||
liquidity_pools_value_history_task >> elementary | ||
trade_agg_task >> elementary | ||
fee_stats_agg_task >> elementary | ||
asset_stats_agg_task >> elementary | ||
network_stats_agg_task >> elementary | ||
partnership_assets_task >> elementary | ||
history_assets >> elementary | ||
soroban >> elementary | ||
liquidity_pool_trade_volume_task >> elementary | ||
snapshot_state >> elementary | ||
relevant_asset_trades >> elementary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this also need
excluded="singular_test"
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need. I checked with the analytics team and this excluded tag for the singular test is related only to EHO, and the exclusion is mainly to avoid testing the same thing in two different workflows in a similar cadence.