-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[DOCS-11631] BigQuery Cost Allocation #30722
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
base: master
Are you sure you want to change the base?
[DOCS-11631] BigQuery Cost Allocation #30722
Conversation
📝 Documentation Team Review RequiredThis pull request requires approval from the @DataDog/documentation team before it can be merged. Please ensure your changes follow our documentation guidelines and wait for a team member to review and approve your changes. |
Preview links (active after the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something about the ordering and flow feels off to me
What do about the Allocating costs
section starting with
Compute allocation
Compute
Query-level tag extraction
- the untitled text under
Allocating costs
Understanding idle costs
Storage
Not sure if I missed anything
Great work, this is really good. I have a number of small comments but overall this is really great work and hits all the key points I would have wanted to know about
[1]: https://app.datadoghq.com/dashboard/ecm-es8-agw/bigquery-allocation | ||
[2]: https://app.datadoghq.com/cost/setup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are both hard coded for the us1 site, maybe somebody from the docs team knows if there is a better way to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See here for an example
[1]: /metrics/#querying-metrics |
/cost/setup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thank you!
|
||
| Feature | Requirements | | ||
|---|---| | ||
| Retrieve tags from labels of a query | Supported without monitoring or reservations | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe say set up GCP CCM costs or something like that
So it is clear you have to have CCM GCP costs set up but you dont need anything else
Not everyone on this page might be a ccm customer
2. Enable BigQuery monitoring in your Google Cloud project. | ||
3. For reservation cost allocation, configure BigQuery reservations in your project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does a user need to explicitly do to set up the bigquery logs? We should either list out the setup exactly or link to a page in the docs and say set this up
Datadog Cloud Cost Management (CCM) automatically allocates the costs of your Google BigQuery resources to individual queries and workloads. Use cost metrics enriched with tags from queries, projects, and reservations to visualize BigQuery workload costs in the context of your entire cloud bill. | ||
|
||
## Resources | ||
CCM allocates costs for BigQuery resources for both types of Analysis costs (on-demand and reservation-based). CCM displays costs for resources including query-level analysis, storage, and data transfer on the [**BigQuery** dashboard][1]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we maybe add a link here to the official bigquery docs on their various pricing models
Not everyone using CCM might know the difference between the two
- `total_slot_usage`: The total slot-seconds used across all queries in the project's reservations | ||
- `total_project_reservation_cost`: The total cost of the reservations in a given project for the time period | ||
|
||
Any difference between the total billed reservation cost and the sum of allocated query costs is categorized as a project's `cluster_idle` cost, representing unused reservation capacity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets be more explicit here. It is tagged with allocated_spend_type:cluster_idle
and maybe also mention usage as well somewhere here for contrast
|
||
CCM extracts the following tags from BigQuery query logs via the Data Observability platform: | ||
|
||
| Tag | Description | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any other tags we can add? What about the tag that has the raw query id, also maybe mention the tag for the region and project id as well because those are super important for bigquery
Those 2 they might know already but customers in general can never find the tags they need, so I dont think it is a bad thing to be a little extra verbose here with the top tags they would care about
|
||
{{< partial name="whats-next/whats-next.html" >}} | ||
|
||
[1]: https://app.datadoghq.com/dashboard/ecm-es8-agw/bigquery-allocation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets make sure we do not merge this PR until this dashboard is pushed to production and the link is corrected to the version that works in everyone's account. Otherwise this is just a link to the internal test version of the dashboard
|
||
Datadog Cloud Cost Management (CCM) automatically allocates the costs of your Google BigQuery resources to individual queries and workloads. Use cost metrics enriched with tags from queries, projects, and reservations to visualize BigQuery workload costs in the context of your entire cloud bill. | ||
|
||
## Resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure what this section is adding? Maybe it can be combined with the overview if there is anything important, otherwise I feel like the rest of the doc covers this.
just my opinion, feel free to ignore me
| Active | Includes any table or table partition that has been modified in the last 90 days | | ||
| Long-term | Includes any table or table partition that has not been modified for 90 consecutive days. The price of storage for that table automatically drops by approximately 50%. There is no difference in performance, durability, or availability between active and long-term storage | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What tag key is this? It is good to in general try and provide a key+value so a user can find it themselves
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its the google_usage_type
tag! I will add that and also add the allocated_spend_type
tag for usage and cluster_idle above!
text: "BigQuery Cost Allocation" | ||
--- | ||
|
||
## Overview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea where this should go but can you add a section on bigquery labels? This is a feature bigquery provides where you can add a label to your bigquery queries and then the labels show up in CCM
It is super powerful for our users and not many know about it
It is documented here https://cloud.google.com/bigquery/docs/adding-labels
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add a section for labels! This is definitely a useful feature 👍
| `project_id` | GCP project ID where the BigQuery resource or job is located | | ||
| `google_location` | The specific Google Cloud region or zone where BigQuery resources are deployed (e.g., us-central1, europe-west1, asia-southeast1) | | ||
| `resource_name` | Full Google Cloud resource identifier | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are project_id and resource_name directly from bills? But I agree these tags are useful for customers to understand the cost allocation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, they are directly from the bills -> CCM doesn't add them. I will split these into a subsection to clarify 👍
What does this PR do? What is the motivation?
Merge instructions
Merge readiness:
For Datadog employees:
Your branch name MUST follow the
<name>/<description>
convention and include the forward slash (/
). Without this format, your pull request will not pass CI, the GitLab pipeline will not run, and you won't get a branch preview. Getting a branch preview makes it easier for us to check any issues with your PR, such as broken links.If your branch doesn't follow this format, rename it or create a new branch and PR.
[6/5/2025] Merge queue has been disabled on the documentation repo. If you have write access to the repo, the PR has been reviewed by a Documentation team member, and all of the required checks have passed, you can use the Squash and Merge button to merge the PR. If you don't have write access, or you need help, reach out in the #documentation channel in Slack.
Additional notes