dbt-labs/dbt-technical-blog-writing

Understanding and parsing the query history (Snowflake) and joining to dbt artifacts

Closed this issue · 1 comments

What's your key point?
How-to guide on how to parse query comments in the Snowflake query history (maybe other dwh as well?). Comparison between using query tags and query comments. Get model level performance metrics by joining the query history to the dbt artifacts in the warehouse

Prior art:
https://discourse.getdbt.com/t/how-to-add-observability-to-your-dbt-deployment/3451
https://coalesce.getdbt.com/talks/observability-within-dbt/

Link to notes / draft:
See above
Any open questions / requests for help from the group?
Yes, I want to know if using query tags over query comments is a better strategy to getting query history at the model level.

I didn't use query tags at first because they are applied at the session level, and I assumed they would be used across models. But I recently learned that dbt is supposed to create a new session for every model, which would mean that I could simply look at the query tag and use that to join to artifacts. At the same time, the docs suggest this approach might be unreliable in the case where a model fails. Would be great to get clarity on this.

@jtalmi we've consolidated our writing into the main dbt Docs repo, and are now utilizing Discussions there, this feel like a perfect candidate for our first Q&A topic if you're willing to repost https://github.com/dbt-labs/docs.getdbt.com/discussions/categories/q-a -- closing for now as we're archiving this repo