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

Allow override of incremental look-back period #140

Merged
merged 4 commits into from
Jan 16, 2024

Conversation

smitsrr
Copy link
Contributor

@smitsrr smitsrr commented Jan 12, 2024

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:

vars:
  dbt_snowflake_monitoring_incremental_days: 0

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.

@smitsrr smitsrr had a problem deploying to Approve Integration Tests January 12, 2024 14:51 — with GitHub Actions Failure
@smitsrr smitsrr had a problem deploying to Approve Integration Tests January 12, 2024 14:51 — with GitHub Actions Failure
-- 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 }})
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjusted!!

@ian-whitestone
Copy link
Contributor

ian-whitestone commented Jan 13, 2024

Thanks for the PR @smitsrr

I'm good with this behaviour given that the field isn't required.

We want to run the package every 10 minutes

Purely out of curiosity, what's the use case / monitoring you are driving off of this?

@smitsrr
Copy link
Contributor Author

smitsrr commented Jan 16, 2024

Thanks for the PR @smitsrr

I'm good with this behaviour given that the field isn't required.

We want to run the package every 10 minutes

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 dbt_artifacts, but that doesn't include all of the queries that are run for an incremental model.
The reason we want to run it so frequently is because it will give us a way to monitor where our daily execution is at, before waiting for the dbt tasks to complete (and on-run-end is executed for dbt artifacts to be written to the db).

@smitsrr smitsrr had a problem deploying to Approve Integration Tests January 16, 2024 12:31 — with GitHub Actions Failure
@smitsrr smitsrr had a problem deploying to Approve Integration Tests January 16, 2024 12:31 — with GitHub Actions Failure
@NiallRees NiallRees had a problem deploying to Approve Integration Tests January 16, 2024 13:03 — with GitHub Actions Failure
@NiallRees NiallRees had a problem deploying to Approve Integration Tests January 16, 2024 13:03 — with GitHub Actions Failure
models/dbt_queries.yml Outdated Show resolved Hide resolved
@NiallRees NiallRees temporarily deployed to Approve Integration Tests January 16, 2024 13:04 — with GitHub Actions Inactive
@NiallRees NiallRees temporarily deployed to Approve Integration Tests January 16, 2024 13:04 — with GitHub Actions Inactive
@ian-whitestone
Copy link
Contributor

First, we love the package for having all of the queries enriched and associated with dbt models. Our other source was dbt_artifacts, but that doesn't include all of the queries that are run for an incremental model.

got it, thanks for the context @smitsrr !!

@NiallRees NiallRees merged commit 5accfcc into get-select:main Jan 16, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants