Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 91 additions & 31 deletions content/en/cloud_cost_management/custom_allocation_rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,25 @@

## Create a custom allocation rule

Before creating your rule, be aware:
- **Result limits**: Some data sources limit how many results they can show. The allocation rule automatically uses your highest-costing items first.
- **Update frequency**:
- Metrics data updates daily for the past 60 days
- Other data sources update daily for the past 7 days

If you need more frequent updates or longer retention, consider using the Metrics data source.

For more information, see [Data source limitations](#data-source-limitations).

### 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, and use the filters under **Define the costs to split (source)** to narrow down the data source.
1. Each data source you add creates a separate grouping for the data.

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

### Step 2 - Choose an allocation method
### Step 2 - Choose a split method

Below is a description of how each allocation method works with examples.

Expand All @@ -44,9 +55,9 @@

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

{{< img src="cloud_cost/custom_allocation_rules/ui-even.png" alt="The even split strategy as seen in Datadog" style="width:90%;" >}}
{{< img src="cloud_cost/custom_allocation_rules/ui-even-1.png" alt="The even split strategy as seen in Datadog" style="width:90%;" >}}

{{% /tab %}}

Expand All @@ -56,7 +67,7 @@

With the custom percentage strategy, you can define static custom percentages for the destination tags you select. For example, if you have 3 destinations (`teamA`, `teamB`, `teamC`) you can allocate 60% to `teamA`, 30% to `teamB`, and 10% to `teamC`.

{{< img src="cloud_cost/custom_allocation_rules/ui-custom.png" alt="The even split strategy as seen in Datadog" style="width:90%;" >}}
{{< img src="cloud_cost/custom_allocation_rules/ui-custom-2.png" alt="The even split strategy as seen in Datadog" style="width:90%;" >}}

{{% /tab %}}

Expand All @@ -70,15 +81,14 @@

To create a rule for this allocation, you can:

- Define the costs to allocate (source): **EC2 support fees** (`aws_product:support`).
- Choose the allocation method: **Proportional by spend**.
- 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 split 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`).
- Refine the allocation by applying [filters](#step-4---optional-apply-filters): **EC2** (`aws_product:ec2`).
- Create suballocations by [partitioning](#step-5---optional-apply-a-partition) the allocation rule: **environment** (`env`).
- Create suballocations by [partitioning](#step-4---optional-apply-a-partition) the allocation rule: **environment** (`env`).

You can also specify how cost proportions should be partitioned to ensure segment-specific allocations. For example, if you partition your costs by environment using tags like `staging` and `production`, the proportions are calculated separately for each environment. This ensures allocations are based on the specific proportions within each partition.

{{< img src="cloud_cost/custom_allocation_rules/ui-proportional-by-spend.png" alt="The proportional split strategy as seen in Datadog" style="width:90%;" >}}
{{< img src="cloud_cost/custom_allocation_rules/ui-proportional-by-spend-2.png" alt="The proportional split strategy as seen in Datadog" style="width:90%;" >}}

{{% /tab %}}

Expand All @@ -92,37 +102,65 @@

To create a rule for this allocation, you could:

- Define the costs to allocate (source): **PostGreSQL costs** (`azure_product_family:dbforpostgresql`).
- Choose the allocation method: **Dynamic by metric**
- 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`).
- 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`).

{{< img src="cloud_cost/custom_allocation_rules/ui-dynamic-by-metric.png" alt="The dynamic by metric split strategy as seen in Datadog" style="width:90%;" >}}
- 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.

This allocation rule works with specific data sources, listed below.

{{% collapse-content title="Supported data sources" level="h4" expanded=false id="supported-data-sources" %}}

Check warning on line 109 in content/en/cloud_cost_management/custom_allocation_rules.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.words

Use 'data sources' instead of 'data-sources'.

- APM Metrics
- Application Security
- Audit Trail
- CI Pipelines
- CI Tests
- Cases
- DORA Metrics
- Database Queries
- Deployment Gates
- Events
- Incidents
- Kubernetes Troubleshooting
- LLM Observability
- Metrics
- NetFlow
- Network
- Network Path
- On-Call
- Profiles
- RUM
- Recommendations
- Security Signals
- Software Composition Analysis
- Synthetics CI Batches

Check warning on line 134 in content/en/cloud_cost_management/custom_allocation_rules.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.words

Use 'Synthetic Monitoring' instead of 'Synthetics'.
- Synthetics Runs

Check warning on line 135 in content/en/cloud_cost_management/custom_allocation_rules.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.words

Use 'Synthetic Monitoring' instead of 'Synthetics'.
- Usage
- Workload Security
- Workload Security Info

{{% /collapse-content %}}

- Choose the split method: **Dynamic by metric**
- Choose the data source: **Database Queries**. Tip: Review available metrics and tags in the [Metrics Summary][4].
- 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`).

{{< img src="cloud_cost/custom_allocation_rules/ui-dynamic-by-metric-4.png" alt="The dynamic by metric split strategy as seen in Datadog" style="width:90%;" >}}

[1]: /metrics/#querying-metrics

{{% /tab %}}

{{< /tabs >}}

### Step 3 - Define the destination

Decide which dimensions, such as `team`, `department`, or `service`, receive the allocated costs. For example:
### Step 3 - Choose the destination(s) to split costs across

You can select multiple values for your destination tag. For instance, if you select the `team` tag, you can choose specific teams like `teamA`, `teamB`, and `teamC` to receive the allocated costs.
1. Select the destinations you want to allocate costs to, such as `team`, `department`, or `service`, receive the allocated costs.

### Step 4 - (optional) Apply filter(s)
You can select multiple values for your destination tag. For instance, if you select the `team` tag, you can choose specific teams like `teamA`, `teamB`, and `teamC` to receive the allocated costs.

Apply a filter across the entire allocation rule. Filters help you target the allocation rule to the relevant subset of your cloud spend.
1. Define the custom percentages for each of the tags you've selected for cost allocation.

_Example: Only apply cost allocation where environment is production._

- **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`.

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

Partitioning allows you to split a single allocation rule into multiple sub-allocations. For example, instead of creating separate rules for each environment (like production and staging), you can create one rule that is partitioned by `environment`. Each partitioned sub-allocation uses the same allocation structure, but applies only to costs matching that tag value.

Expand Down Expand Up @@ -170,9 +208,31 @@

{{< img src="cloud_cost/custom_allocation_rules/visualize_your_allocations-1.png" alt="See your allocations throughout Datadog" style="width:90%;" >}}

## Data source limitations
### Some data sources limit the number of group bys
available. When this limit is reached, the allocation rule distributes costs
across the available group bys in sorted order (highest cost first). For

Check notice on line 214 in content/en/cloud_cost_management/custom_allocation_rules.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.sentencelength

Suggestion: Try to keep your sentence length to 25 words or fewer.
example, if your query editor shows a limit of 100 group bys but you have
101 results, the allocation rule distributes costs across the top 100
highest-costing group bys and ignore the remaining 1 completely. Similarly,

Check notice on line 217 in content/en/cloud_cost_management/custom_allocation_rules.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.sentencelength

Suggestion: Try to keep your sentence length to 25 words or fewer.
if you have 3 total results but a limit of 2, the allocation rule
distributes costs across the top 2 highest-costing group bys (for example,
50% and 50%) and ignores the third result completely.

### Retention period
While CCM has 15 months of retention overall, individual data sources have different update patterns:
- **Metrics data source**: Updates the past 60 days daily
- **All other data sources**: Backfill 60 days at rule creation, then
update the past 7 days daily

### Supported data sources for dynamic allocation

The dynamic by metric allocation method only supports a [specific set of data sources](#supported-data-sources).

## Further reading
{{< partial name="whats-next/whats-next.html" >}}

[1]: /cloud_cost_management/tag_pipelines
[2]: https://app.datadoghq.com/cost/settings/custom-allocation-rules
[3]: https://www.datadoghq.com/support/
[4]: https://app.datadoghq.com/metric/summary
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading