Custom Allocation Rules

Overview

Custom cost allocation allows you to showback or chargeback your costs by attributing selected costs to relevant business dimensions. After you have set up allocation rules, you can report on which costs were allocated by a rule.

Custom cost allocation runs after Tag Pipelines, enabling allocations based on user-defined tags. Costs are allocated on a daily basis, and can be applied to Cloud Cost metrics from AWS, Google Cloud, and Azure.

Rule creation

Access the Custom Allocation Rules section under Cloud Cost settings to establish rules. Choose from the following allocation methods:

Allocation MethodDescriptionExamples
EvenCosts are allocated evenly to your destination tags.Untagged support costs are allocated evenly to teams teamA, teamB, and teamC.
Custom PercentageCosts are allocated based on custom percentages for the destination tags.Untagged support costs are allocated 60% to teamA, 30% to teamB, and 10% to teamC.
ProportionalCosts are allocated based on the proportional spend of destination values.Untagged support costs are allocated to teams teamA, teamB, and teamC based on their proportion of total spend on Amazon EC2.
Dynamic by MetricCosts are allocated based on the proportional amount of a defined metric.Shared PostgreSQL costs are allocated by total query execution time to users as defined by the Datadog metrics query sum:postgresql.queries.time{*} by {user}.as_count().

Allocation methods

With the even strategy, costs are allocated evenly towards your destination tags, regardless of any other spend. Apply a filter to refine which part of the bill determines the proportions.

Diagram illustrating the even split strategy
The even split strategy as seen in Datadog

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.

Diagram illustrating the even split strategy
The even split strategy as seen in Datadog

Costs are allocated based on the proportional spend of destination values. Similarly to even allocation, you can further customize your allocation by setting filters and partitions.

Diagram illustrating the proportional split strategy
The proportional split strategy as seen in Datadog

Metrics-based allocation provides the ability to split up costs based on Datadog’s metrics queries. By using performance metrics to allocate expenses, you can more accurately allocate costs based on application usage patterns.

For example, this PostgreSQL metrics query sum:postgresql.queries.time{*} by {user}.as_count() tracks the total query execution time per user. The relative values are then used to determine what proportion of total PostgreSQL costs should be allocated to each user.

For determining the proportion of costs to be allocate, metrics can be aggregated on a daily or monthly basis. However, the costs themselves are still allocated on a daily basis.

Diagram illustrating the dynamic by metric strategy
The dynamic by metric split strategy as seen in Datadog

Specify what costs are included in the allocation

StepRequiredExamples
Select the cost providerYesAWS, Google Cloud, Azure
Define the costs to split (source)Yesaws_product contains support, allocated_spend_type is untagged
Define the destinationYesteam is teamA, teamB, teamC
Filter byOnly applicable for Even and Proportional strategies, optionalaws_product is ec2
Partition costs byOnly applicable for Even, Proportional, and Dynamic by Metric strategies, optionalenvironment is all values
NameYesallocate_untagged_support_costs

Partitioning

For some of the allocation strategies, you can specify how cost proportions should be partitioned to ensure segment-specific allocations. For example, with proportional allocation, 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.

Diagram illustrating the proportional split strategy with partitioning

Managing rules

Rules can be modified and deleted in the Custom Allocation Rules section of the Cloud Cost settings page. All fields except for the rule name can be reconfigured.

Rules are applied in the same order as shown in the list.

Visualize your allocations

Changes to custom allocation rules may take up to 24 hours to be applied. After being applied, the new allocations can be seen throughout Cloud Cost Management on all costs that have Container Allocation enabled. Custom allocated costs also include an allocated_by_rule tag, denoting the rule name that applied the allocation.

See your allocations throughout Datadog

Further reading

Additional helpful documentation, links, and articles: