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

Improve handling of overage spend #154

Merged
merged 3 commits into from
May 14, 2024

Conversation

fernandobrito
Copy link
Contributor

@fernandobrito fernandobrito commented May 14, 2024

In a previous PR (#152), I added new Snowflake services to hourly_spend. For some services, the cost was calculated by taking the daily spend from the USAGE_IN_CURRENCY_DAILY view and splitting it by each hour of the day.

The values in the column usage_type in USAGE_IN_CURRENCY_DAILY can be prefixed with overage- if they come from overage spend, and this was not taken into account in my previous PR.

Similar to what this library does to the daily_rates (source), this PR normalizes the value in this column by removing overage- if it's present.

The following services were added in my previous PR:

  • Reader account (compute, storage, cloud services, data transfer): affected. Fixed in this PR.
  • AI Services: affected. Fixed in this PR.
  • Logging: affected. Fixed in this PR.
  • Hybrid Tables (storage and request costs): not affected
  • SnowPark Container Services: not affected
  • Copy Files (serverless cost for copying files between named stages): not affected

The following services were not added in the previous PR but were affected and have now been fixed:

  • Data Transfer

QA

Tested locally.

image

@fernandobrito fernandobrito had a problem deploying to Approve Integration Tests May 14, 2024 12:25 — with GitHub Actions Failure
@fernandobrito fernandobrito had a problem deploying to Approve Integration Tests May 14, 2024 12:25 — with GitHub Actions Failure
@fernandobrito fernandobrito temporarily deployed to Approve Integration Tests May 14, 2024 13:02 — with GitHub Actions Inactive
@fernandobrito fernandobrito had a problem deploying to Approve Integration Tests May 14, 2024 13:02 — with GitHub Actions Failure
@fernandobrito fernandobrito had a problem deploying to Approve Integration Tests May 14, 2024 15:48 — with GitHub Actions Failure
@fernandobrito fernandobrito had a problem deploying to Approve Integration Tests May 14, 2024 15:48 — with GitHub Actions Failure
@ian-whitestone ian-whitestone merged commit 0647867 into main May 14, 2024
0 of 2 checks passed
@ian-whitestone ian-whitestone deleted the take-overage-spend-into-account branch May 14, 2024 16:43
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.

2 participants