-
Notifications
You must be signed in to change notification settings - Fork 42
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
Allow override of incremental look-back period #140
Allow override of incremental look-back period #140
Conversation
models/query_history_enriched.sql
Outdated
-- which changes the cost per query | ||
where end_time > (select dateadd(day, -7, max(end_time)) from {{ this }}) | ||
and end_time > (select dateadd(day, -{{ var('dbt_snowflake_monitoring_incremental_days', '7') }}, max(end_time)) from {{ this }}) |
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.
don't think this syntax is valid, need the where
.
same thing below.
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.
adjusted!!
Thanks for the PR @smitsrr I'm good with this behaviour given that the field isn't required.
Purely out of curiosity, what's the use case / monitoring you are driving off of this? |
First, we love the package for having all of the queries enriched and associated with dbt models. Our other source was |
got it, thanks for the context @smitsrr !! |
This doesn't fail if you don't have the project variable declared, but does allow for changing the incremental look-back period by setting the variable in the project:
Why:
We want to run the package every 10 minutes and a 7-day look back period is prohibitively expensive (by time and cost). For our use case, we don't care about the potential loss of accuracy due to late-arriving rate data.