Skip to main content
Shared cost allocation is one of the hardest problems in FinOps. Your shared Cloud SQL database costs $10K/month, but how much should each team pay? Instead of guessing a 50/50 split, Costory allocates $7K to Team A and $3K to Team B based on actual database usage from Datadog. Connect any usage metric, and Costory splits the cost proportionally. No manual percentages to maintain.
Pie chart showing database cost split proportionally across three teams based on usage

Key terms

  • Shared cost allocation: The process of distributing a shared infrastructure cost across the teams or services that consume it, proportionally based on usage.
  • Usage metric: An external measurement (e.g., database size per schema, CPU time per user, API calls per team) used to determine each team’s share of a shared cost.
  • Virtual Dimension: A rule-based cost grouping. Shared cost allocation is configured as a special type of Virtual Dimension rule. See Virtual Dimensions.
See the Glossary for a full list of terms.

Supported metric sources

Costory can pull usage metrics from several data sources to drive proportional cost allocation.

Datadog

BigQuery

Snowflake

Google Sheets

Connect your metric source in Setup > Usage Metrics, then reference it in a rule.

How it works

1

Connect a usage metric source

Navigate to Setup > Usage Metrics and connect one of the supported sources (Datadog, BigQuery, Snowflake, or Google Sheets). See the Usage Metrics setup guide for details.
2

Create or edit a Virtual Dimension

Open the Virtual Dimension where you want to add shared cost allocation (e.g., “Team”). See Virtual Dimensions if you haven’t created one yet.
3

Add a metric-based rule

Select the usage metric you connected. Costory will use the metric’s values to determine each team’s proportional share of the cost.
4

Map metric dimensions to teams

Tell Costory how metric labels correspond to team names. Three mapping types are available (see below).
5

Apply

Costory reprocesses your data. The shared cost is split proportionally and appears in the Cost Explorer grouped by team.

Mapping metric labels to teams

When a usage metric has dimension labels (e.g., a schema label per database schema), you need to map those labels to the team names in your Virtual Dimension.
Mapping typeHow it worksWhen to use
IdentityThe metric label already matches the team name exactlyYour metric labels and team names are the same (e.g., payments in both)
RegexExtract the team name from the metric label using a regular expressionLabels follow a pattern like team-payments-prod and you need to extract payments
ManualExplicitly assign each metric label to a teamLabels don’t follow a pattern, or you need full control over the mapping

Common allocation patterns

Shared cost allocation works well for:
  • Shared databases (Cloud SQL, RDS, Aurora), split by schema size, query count, or connection time per team
  • Network and egress costs, split by traffic volume per namespace or service
  • Shared Kubernetes clusters, split by CPU or memory usage per namespace. See EKS/ECS visibility for a full example.
  • Third-party API costs, split by API call count per team. See Reallocate API Costs for a walkthrough.
  • Support and licensing fees, split proportionally based on each team’s share of total spend

Automate reporting

Once costs are allocated, you can automate weekly reports per team via Slack Reports. Each team sees their share of shared infrastructure alongside their direct costs, all in one place.
For a step-by-step walkthrough, see Allocate a shared Cloud SQL database.

Next Steps

Virtual Dimensions

Build rule-based allocations and composable hierarchies

Allocate a Shared Database

Step-by-step: split a Cloud SQL bill across teams

Reallocate API Costs

Split shared API costs using an external usage metric

Usage Metrics Setup

Connect Datadog, BigQuery, Snowflake, or Google Sheets
Last modified on March 16, 2026