Concepts

Allocation model

How filters, tags, virtual tags and allocation rules differ, and how Costfluent assigns every cost line to exactly one owner or reports it as unallocated.

Allocation answers "who owns this cost?" Costfluent keeps it separate from filtering and from tagging, because each answers a different question.

Four tools, four questions

ToolQuestion it answersWhere it lives
FilterWhich cost is in this report?One cost report
TagWhat did the resource's owner write on it?Your cloud accounts; Costfluent reads it
Virtual tagWhat value should this cost line carry, whatever the source tags say?A workspace; see Virtual tags
Allocation ruleWhich segment owns this cost line?A workspace; see Segments and allocation rules

A filter narrows one report and leaves every other report alone. Tags and virtual tags describe cost lines; a report can filter or group by them. Allocation rules assign each cost line to a segment. A cost report grouped by Segment shows each segment's direct cost and lists shared cost under "Unallocated"; only the Coverage card on the Segments page spreads shared cost across segments.

Segments

A segment is one owner that cost can be assigned to. Team, product and cost centre together identify it, so the same owner cannot be typed two ways and split a report. Matching ignores case, so "Platform" and "platform" are the same team. A shared segment is a bucket for cost that belongs to no single owner, such as a Kubernetes cluster or a platform team. A workspace can hold several, each with its own label, and one without a label.

Ordered rules, one claim per cost line

Rules are evaluated in order, top first. The first rule that matches a cost line claims it, and no later rule can claim it again, so no cost is counted twice. A rule added in the console joins the end of the list; one created through the Public API or the Terraform provider is placed by its priority, lower first. Moving a rule up or down changes which rule claims a line first. When a rule is deleted, each line it claimed goes to the next active rule that matches it, or stays unallocated. A rule matches with a cost filter, the same filter language reports use: any field such as service, region, provider, account, resource group, resource name or a tag, combined with AND and OR. A rule cannot read a virtual tag.

Shared cost

A rule pointing at a shared segment puts the cost it claims into that segment's pool. Each shared segment splits its own pool, per billing currency, in one of three ways:

  • Proportional to direct cost, the default: across the direct segments in proportion to their positive direct billed cost in the same period. If there is no direct cost to spread it across, the pool stays unallocated rather than being absorbed silently.
  • Even: the same share to each of two or more chosen direct segments, whatever their direct cost.
  • Fixed percentages: a fixed percentage, with at most two decimals, to each chosen direct segment, the percentages adding up to exactly 100.

Every share but the last is rounded to eight decimal places, and the last segment in the split's order takes the rest, so the shares add up to the pool exactly. The difference between that last share and its own rounded exact share is the rounding residual, which the Coverage card lists under Shared pools. A segment an even or percent split names receives its share even in a month it has no direct cost.

No No rule left Yes Yes No Yes Cost line Rule 1matches? Next rulematches? Unallocated Its segmentis shared? Direct cost ofthat segment Shared pool, splitacross direct segments
The first rule that matches claims a cost line; a shared segment's pool is then split across the direct segments, and a line no rule claims stays unallocated.

Exact totals and visible unallocated cost

Allocation never creates or loses money: the direct, shared and unallocated amounts always add up to the workspace total. Cost no rule claims is reported as unallocated, and the Coverage card on the Segments page shows how much of the last whole month's total is assigned.

Evaluated when a report is read

Rules are never written onto cost records. They are compiled into each query, so adding, disabling, reordering or deleting a rule restates every past month at once, without collecting anything again. Changing a shared segment's split does the same. The same holds for virtual tags. Select Preview before saving a rule to see what it would move; it runs the same calculation a report does.