dbt-snowflake-monitoring icon indicating copy to clipboard operation
dbt-snowflake-monitoring copied to clipboard

Add credit consumption to cost per query

Open ian-whitestone opened this issue 2 years ago • 6 comments

Some users may prefer to work with credits instead of cost.

One use case could be forecasting model cost and a new credit rate.

ian-whitestone avatar Jan 09 '23 17:01 ian-whitestone

Another use case brought up by a user if they have some discounts applied so multiplying by the cost per credit is incorrect for true cost.

ian-whitestone avatar Jan 09 '23 17:01 ian-whitestone

Is anyone currently handling this matter? We signed the contract through Snowflake dealers, so we do not have data such as rate_sheet_daily, remaining_balance_daily and usage_in_currency_daily. If credit can be added, then we can use this tool. If no one is currently handling it, I am willing to contribute.

yingyingqiqi avatar Aug 11 '23 08:08 yingyingqiqi

Hi @yingyingqiqi , no one is currently working to add this. If you are willing to contribute that would be great.

You just need to add the columns here: https://github.com/get-select/dbt-snowflake-monitoring/blob/main/models/cost_per_query.sql#L142-L148

Then again in here https://github.com/get-select/dbt-snowflake-monitoring/blob/main/models/query_history_enriched.sql#L45-L47

Here is our contributing guide: https://select.dev/docs/dbt-snowflake-monitoring/contributing

ian-whitestone avatar Aug 11 '23 12:08 ian-whitestone

Hi @ian-whitestone If you have time, please check it for me, thanks.

Also, I would like to add credit to hourly_spend, daily_spend as well , is that ok with you?

yingyingqiqi avatar Aug 14 '23 16:08 yingyingqiqi

Also, I would like to add credit to hourly_spend, daily_spend as well , is that ok with you?

sounds good 👍 , can we do that in a separate PR?

ian-whitestone avatar Aug 15 '23 02:08 ian-whitestone

Yes, I will create a new PR later.

yingyingqiqi avatar Aug 15 '23 04:08 yingyingqiqi