Skip to content

[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

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

rtrieu
Copy link
Contributor

@rtrieu rtrieu commented Jul 25, 2025

What does this PR do? What is the motivation?

  • Adds a new Cost Allocation landing page
  • Reorganizes the Container Cost Allocation section to accommodate new BigQuery page and existing providers
  • Adds a new BigQuery Cost Allocation page

Merge instructions

Merge readiness:

  • Ready for merge

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

@rtrieu rtrieu added the WORK IN PROGRESS No review needed, it's a wip ;) label Jul 25, 2025
@rtrieu rtrieu requested review from a team as code owners July 25, 2025 20:08
@github-actions github-actions bot added the Architecture Everything related to the Doc backend label Jul 25, 2025
Copy link
Contributor

github-actions bot commented Jul 25, 2025

📝 Documentation Team Review Required

This 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.

Copy link
Member

@elihschiff elihschiff left a 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

  1. Compute allocation
  2. Compute
  3. Query-level tag extraction
  4. the untitled text under Allocating costs
  5. Understanding idle costs
  6. 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

Comment on lines 111 to 112
[1]: https://app.datadoghq.com/dashboard/ecm-es8-agw/bigquery-allocation
[2]: https://app.datadoghq.com/cost/setup
Copy link
Member

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?

Copy link
Contributor

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

you can basically drop everything up to /cost/setup

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 |
Copy link
Member

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

Comment on lines 28 to 29
2. Enable BigQuery monitoring in your Google Cloud project.
3. For reservation cost allocation, configure BigQuery reservations in your project.
Copy link
Member

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].
Copy link
Member

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.
Copy link
Member

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 |
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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

Comment on lines 104 to 105
| 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 |
Copy link
Member

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

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
Copy link
Member

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

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 👍

Comment on lines +91 to +93
| `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 |
Copy link
Contributor

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.

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 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture Everything related to the Doc backend WORK IN PROGRESS No review needed, it's a wip ;)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants