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

[CT-2180] [Feature] Add bytes_billed to adapter response #560

Closed
3 tasks done
bruno-szdl opened this issue Feb 24, 2023 · 2 comments · Fixed by #570
Closed
3 tasks done

[CT-2180] [Feature] Add bytes_billed to adapter response #560

bruno-szdl opened this issue Feb 24, 2023 · 2 comments · Fixed by #570
Labels
feature:cost-reduction Issues related to cost tracking in BigQuery good_first_issue Good for newcomers type:enhancement New feature or request

Comments

@bruno-szdl
Copy link
Contributor

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt-bigquery functionality, rather than a Big Idea better suited to a discussion

Describe the feature

I am working to monitor the BigQuery costs in our projects more efficiently.

Today what dbt returns is bytes_processed from job's total_bytes_processed, which is almost the same as total_bytes_billed. The differences, as I know them, are that total_bytes_billed is rounded to the nearest MB, and if the query is less than 10MB, total_bytes_billed will be 10MB.

So total_bytes_processed is not 100% exactly what is charged.

I think total_bytes_processed is good for monitoring query performance, and total_bytes_billed is good for knowing the real cost.

You can calculate total_bytes_billed from total_bytes_processed easily, just apply a couple of rules there. But if BigQuery already returns the calculated total_bytes_billed, there's no point in making this transformation again.

Besides, this way there's no risk of making a wrong transformation, or the BQ changing some billing rule.

So I would like to add total_bytes_billed to the adapter_response so we can easily calculate the billing costs.

Describe alternatives you've considered

It seems very straightforward, just do the same as this PR
#271

But instead of slot time, we want the bytes billed. I think it is a good first issue.

Who will this benefit?

This would help people calculate the costs of BigQuery queries, by letting BigQuery say the bytes billed, instead of calculating themselves.

Are you interested in contributing this feature?

Yes, I think I could add bytes_billed to the adapter response.

Anything else?

No response

@github-actions github-actions bot changed the title [Feature] Add bytes_billed to adapter response [CT-2180] [Feature] Add bytes_billed to adapter response Feb 24, 2023
@Fleid
Copy link
Contributor

Fleid commented Feb 27, 2023

Hi @bruno-szdl, thanks a lot for the detailed issue, including research for similar prior art :)
This sounds like a good idea and a solid plan.

Removing triage and adding good_first_issue (equivalent to help_wanted).

@Fleid Fleid added good_first_issue Good for newcomers and removed triage:product labels Feb 27, 2023
@bruno-szdl
Copy link
Contributor Author

Thanks for the reply @Fleid !

I will work on that! Soon I will create a PR for this issue. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:cost-reduction Issues related to cost tracking in BigQuery good_first_issue Good for newcomers type:enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants