Skip to content

[DOCS-11489] CCM new data source #30521

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 5 commits into
base: master
Choose a base branch
from

Conversation

rtrieu
Copy link
Contributor

@rtrieu rtrieu commented Jul 16, 2025

What does this PR do? What is the motivation?

  • Reorders a few steps based on updated UI
  • Updated screenshots
  • Adds info about data source limitations

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 requested a review from a team as a code owner July 16, 2025 20:08
@rtrieu rtrieu added the WORK IN PROGRESS No review needed, it's a wip ;) label Jul 16, 2025
@github-actions github-actions bot added the Images Images are added/removed with this PR label Jul 16, 2025
Copy link
Contributor

github-actions bot commented Jul 16, 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
Contributor

Preview links (active after the build_preview check completes)

Modified Files

@rtrieu rtrieu requested a review from helenmtang July 17, 2025 17:13

## Create a custom allocation rule

### Step 1 - Define the source

1. Navigate to [Cloud Cost > Settings > Custom Allocation Rules][2] and click **Add New Rule** to start.
2. From the dropdown, select the shared costs you want to allocate.
1. Under **Define the source**, select the cost provider.
1. Each data source you add creates a separate grouping for the data.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Each data source you add creates a separate grouping for the data.
1. Under **Define the costs to split**, select the shared costs you want to allocate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! Data source doesn't apply here — it applies to the Dynamic by metric section, under allocaiton type


_Example: Untagged support costs, shared database costs._
_For example, you may want to apply the allocation rule to a specific subset of your cloud spend, such as the `production` environment._
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_For example, you may want to apply the allocation rule to a specific subset of your cloud spend, such as the `production` environment._
_Example: Untagged support costs, shared database costs._

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the original is good!

@@ -44,9 +45,9 @@ Below is a description of how each allocation method works with examples.

{{< img src="cloud_cost/custom_allocation_rules/even_diagram.png" alt="Diagram illustrating the even split strategy" style="width:70%;" >}}

With the even strategy, costs are allocated evenly towards your destination tags. [Apply a filter](#step-4---optional-apply-filters) to refine which part of the bill determines the proportions.
With the even strategy, costs are allocated evenly towards your destination tags.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
With the even strategy, costs are allocated evenly towards your destination tags.
With the even strategy, costs are allocated evenly towards your destination tags. [Apply a filter](#step-4---optional-apply-filters) to refine which part of the bill determines the proportions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm it looks like there's nowhere else in the doc where we can explain that Even Allocaiton has filters, so let's keep this in here?

@@ -70,15 +71,14 @@ In the preceding diagram, the pink bar represents a filter on the cost allocatio

To create a rule for this allocation, you can:

- Define the costs to allocate (source): **EC2 support fees** (`aws_product:support`).
- Define the costs to allocate (source): **EC2 support fees** (`aws_product:support`). Use filters to narrow down the data source. Each source you add creates a separate grouping for the data.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Define the costs to allocate (source): **EC2 support fees** (`aws_product:support`). Use filters to narrow down the data source. Each source you add creates a separate grouping for the data.
- Define the costs to allocate (source): **EC2 support fees** (`aws_product:support`).

@@ -70,15 +71,14 @@ In the preceding diagram, the pink bar represents a filter on the cost allocatio

To create a rule for this allocation, you can:

- Define the costs to allocate (source): **EC2 support fees** (`aws_product:support`).
- Define the costs to allocate (source): **EC2 support fees** (`aws_product:support`). Use filters to narrow down the data source. Each source you add creates a separate grouping for the data.
- Choose the allocation method: **Proportional by spend**.
- Choose the [destination tag](#step-3---define-the-destination) to split your costs by: **User** (`User A`, `User B`, `User C`).
Copy link
Contributor

@helenmtang helenmtang Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Choose the [destination tag](#step-3---define-the-destination) to split your costs by: **User** (`User A`, `User B`, `User C`).
- Choose the [destination tag](#step-3---define-the-destination) to split your costs by: **User** (`User A`, `User B`, `User C`).
- Refine the allocation by applying [filters](#step-4---optional-apply-filters): **EC2** (`aws_product:ec2`).```

To create a rule for this allocation, you could:

- Define the costs to allocate (source): **PostGreSQL costs** (`azure_product_family:dbforpostgresql`).
- Define the costs to allocate (source): **Database costs** (`aws_product:rds`). Use filters to narrow down the data source. Each source you add creates a separate grouping for the data.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Define the costs to allocate (source): **Database costs** (`aws_product:rds`). Use filters to narrow down the data source. Each source you add creates a separate grouping for the data.
- Define the costs to allocate (source): **NAT gateway costs** (`aws_operation:NatGateway`).

- Refine the allocation by applying [filters](#step-4---optional-apply-filters): **EC2** (`aws_product:ec2`).
- Define the metric query used to split the source costs: **Query execution time per user** (`sum:postgresql.queries.time{*}` by `{user}.as_count`).
- Create suballocations by [partitioning](#step-5---optional-apply-a-partition) the allocation rule: **environment** (`env`).
- Choose the data source: **Database Queries**. Tip: Review available metrics and tags in the [Metrics Summary][2].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Choose the data source: **Database Queries**. Tip: Review available metrics and tags in the [Metrics Summary][2].
- Choose the data source: **Network**. Tip: Review available metrics and tags in the [Metrics Summary][2].

- Define the metric query used to split the source costs: **Query execution time per user** (`sum:postgresql.queries.time{*}` by `{user}.as_count`).
- Create suballocations by [partitioning](#step-5---optional-apply-a-partition) the allocation rule: **environment** (`env`).
- Choose the data source: **Database Queries**. Tip: Review available metrics and tags in the [Metrics Summary][2].
- Choose the [destination tag](#step-3---define-the-destination) to split your costs by: **Service** (`trace.caller.service`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Choose the [destination tag](#step-3---define-the-destination) to split your costs by: **Service** (`trace.caller.service`).
- Refine the allocation by applying a [filter](#step-4---optional-apply-filters):**NAT Gateway** (`server_gateway_id:nat-*`). This filters the metric to only return data for your NAT Gateway usage.
- Choose the [destination tag](#step-3---define-the-destination) to split your costs by applying a group by. In Network, do this by filling out the `View clients as` section: **service** (`client_service`). This groups the metric by service.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this too wordy?

- Create suballocations by [partitioning](#step-5---optional-apply-a-partition) the allocation rule: **environment** (`env`).
- Choose the data source: **Database Queries**. Tip: Review available metrics and tags in the [Metrics Summary][2].
- Choose the [destination tag](#step-3---define-the-destination) to split your costs by: **Service** (`trace.caller.service`).
- Create suballocations by [partitioning](#step-4---optional-apply-a-partition) the allocation rule: **environment** (`env`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Create suballocations by [partitioning](#step-4---optional-apply-a-partition) the allocation rule: **environment** (`env`).
- Create suballocations by [partitioning](#step-4---optional-apply-a-partition) the allocation rule. To do this, first apply another group by to the metric. In Network, do this by filling out the `View servers as` section: **Gateway ID** (`gateway_id`). This groups the metric by gateway_id. Then, select `server_gateway_id` in the **Partition source costs by** section.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this make sense? Should we add another sentence "Note: if you do not define a partition, the allocation rule will consider all group by tags as your destination tags, and split source costs across all destinations."


- **Proportional by spend**: Let's say you allocate shared costs to the team tag, proportional to how much each team spends. You can add a filter, creating a cost allocation that is proportional to how much team spends on `aws_product` is `ec2`.
- **Dynamic by metric**: Let's say you allocate shared PostgreSQL costs to the service tag, proportional to the query execution time of each service. You can add a filter, creating a cost allocation that only applies where `environment` is `production`.
1. Define the custom percentages for each of the tags you've selected for cost allocation.
Copy link
Contributor

@helenmtang helenmtang Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Define the custom percentages for each of the tags you've selected for cost allocation.
### Step 4 - (optional) Apply filter(s)
Apply a filter across the entire allocation rule. Filters help you target the allocation rule to the relevant subset of your cloud spend.
- **Proportional by spend**: Let's say you allocate shared costs to the team tag, proportional to how much each team spends. You can add a filter, creating a cost allocation that is proportional to how much team spends on `aws_product` is `ec2`.
- **Dynamic by metric**: Let's say you allocate shared PostgreSQL costs to the service tag, proportional to the query execution time of each service. You can add a filter, creating a cost allocation that only applies where `environment` is `production`. Note: since the Dynamic by metric allocation type uses a metric to create the cost allocation, you apply the filter to the allocation rule by filtering the metric query itself.

Copy link
Contributor

@helenmtang helenmtang Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lmk if this makes sense!


### Step 5 - (optional) Apply a partition
### Step 4 - (optional) Apply a partition
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Step 4 - (optional) Apply a partition
### Step 5 - (optional) Apply a partition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Images Images are added/removed with this PR WORK IN PROGRESS No review needed, it's a wip ;)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants