Segments and allocation rules
Define the segments cost belongs to, split shared cost across them, write ordered rules that assign cost to them, preview a rule before saving, and read coverage.
The Segments page, under Allocation, assigns each cost line in a workspace to one owner. The principles are in Allocation model; this page covers the steps.
Before you start
- Viewing segments needs any team role. Adding and changing segments and rules needs the Editor team role in a workspace your team can edit.
- Your plan limits how many allocation rules your organization can have, counted across its workspaces; see the pricing page.
- Tagged resources make rules simpler. Check tag coverage first.

Add a segment
- On the Segments card, select Add segment.
- Enter the Team, Product and Cost centre. The team is a name, so an owner does not have to exist as a team in Costfluent first. Each field suggests the values the workspace's segments already use, so the same owner is not typed two ways.
- Optionally, under Weekly digest to, choose an email, Slack or Microsoft Teams app from Notification channels to send the team a weekly digest of its cost.
- Select Save.
The confirmation offers Add a rule for it, which opens a new rule with the segment chosen: a segment receives cost only once a rule assigns some to it.
A segment added here arrives with its own cost report under Cost reports: titled from its team and product, such as Platform / Checkout, filtered to the segment and grouped by service. With a channel chosen, the report also gets a weekly schedule to that channel, named after the report followed by "weekly digest"; change, pause or delete it under the report's Schedule, as Share and schedule reports describes. A segment created through the Public API or the Terraform provider arrives with neither.
Team, product and cost centre together identify a segment, ignoring letter case and surrounding spaces, so two segments cannot have the same three. Saving one that already exists shows "Could not save the segment. A segment with this team, product and cost centre may already exist." Saving a segment unchanged, or changing only the letter case of its names, keeps the same segment.
The Public API can also link a segment to one of your organization's teams (teamId).
Add a shared segment
A shared segment collects cost that no one team owns, such as a Kubernetes cluster or a platform team, and spreads it across direct segments. A workspace can hold several, one per label, and one without a label.
- On the Segments card, select Add segment.
- Under Segment type, choose Shared: a pool spread across direct segments.
- Enter a Label, such as Cluster, or leave it empty for the workspace's one unlabelled shared segment.
- Under Split, choose how the pool is spread: Proportional to direct cost, Even or Fixed percentages.
- For Even or Fixed percentages, select Add a segment under Segments that receive a share for each direct segment, in order. For Fixed percentages, give each one a percentage with at most two decimals; the total under the list has to reach exactly 100%.
- Select Save.

A shared segment has no cost report of its own. Point a rule at it to fill its pool: select Add a rule for it on the confirmation after saving, or choose it as the rule's Segment, where shared segments are listed by their label and the unlabelled one as Shared cost. The Public API and the Terraform provider create and change shared segments with label and split too.
Change a shared segment's split
- Select the pencil on the shared segment's row.
- Change the Label, the Split or the Segments that receive a share. Use the arrows to reorder them: the last segment takes the rounding residual.
- Read What this split gives each segment: each segment's share of the pool over the last whole calendar month, per currency, with the rounding residual and the segment that carries it.
- Select Save.
A split is applied when a report is read, so saving one restates every past month at once, as changing a rule does.
Edit or delete a segment
- Edit: select the pencil on the segment's row, change the Team, Product or Cost centre in Edit segment, and select Save. Rules point at a segment by identity, so renaming one changes no rule. A shared segment is changed as Change a shared segment's split describes, and never becomes a direct one.
- Delete: select the bin on the segment's row and confirm with Delete in Delete this segment?. Costfluent refuses while any rule still assigns cost to the segment, a budget measures it or a shared segment's split names it, and names those budgets and shared segments. Re-point or delete those rules, and remove the segment from those splits, first. Once none of them does, Costfluent still refuses while a cost report, cost alert or saved filter filters to the segment, and names them: take the segment out of their filters or delete them first. That includes the report a segment added here arrives with, under Cost reports.
Add a rule
- On the Rules card, select Add rule and enter a Name. The button is available once at least one segment exists.
- Build the Filter that says which cost the rule claims, with the same conditions a report uses: Add filter adds a condition on a field such as Service, Region, Provider, Sub-account, Resource group, Resource name or a Tag, and Edit as text opens Filter as CQL to write it as text, which is also how to combine conditions with OR. See Filter with CQL. A rule needs at least one condition and cannot use a virtual tag.
- Choose the Segment the rule assigns cost to. Segments are listed by team, product and cost centre, and shared segments by their label.
- Leave Claims cost on, or turn it off to save the rule without it claiming anything yet.
- Select Preview. What this rule would move shows the amount and how coverage would change, computed on the same committed cost a report reads, with the rule in its place in the list. Nothing is saved yet.
- Select Save. A new rule is added last; the dialog says which number it gets. To let it claim cost before the rules above it, move it up the list.
The Rules table lists each rule with its Order, its number in the list, its Name, what it Matches, each condition as its field, operator and values with "or" between alternatives (a filter the console cannot show that way is written as CQL), its Segment, named by its team, product and cost centre or a shared segment by its label, and its State, Active or Disabled. Open as report on a segment opens a new report filtered to that segment. Move up and Move down reorder rules; the pencil edits a rule, and the bin deletes it after Delete this rule?.
Read coverage
Coverage measures the last whole calendar month; the dates under its title are that month's first and last day. For each currency it shows the coverage percentage, the Total and how much of it is Direct, Shared and Unallocated. Under Shared pools it lists each shared segment's pool with its split, each segment's share and the rounding residual. When a proportional pool has no direct segment to spread across, the card says how much was counted as unallocated for that reason. A month with no committed cost reads "No committed cost in this window yet." When the month's AWS cost came from Cost Explorer, which carries no tags or resources, the card names the month, because no rule can claim that cost (History and first delivery).
While some cost is unallocated, the card shows Open this month by segment to see what is unallocated under the figures; it opens a new report over the same month grouped by Segment. Cost no rule claims is its Unallocated row, which in a grouped report also holds shared cost; that row shows what the next rule should cover.
To see cost per segment over time, open a cost report and set Group by to Segment.
Filter a report to a segment
A report filtered to a segment shows the cost the rules assign to it directly, plus its share of shared cost, split the way Coverage splits it.
- Select Open as report on the segment's row, or open a report under Cost reports.
- To filter an open report, select Add filter and choose Segment and the segment, or select Edit as text and write
costs.segment = 'seg_...'in Filter as CQL. Several segments go in one condition:costs.segment IN ('seg_...', 'seg_...'). See Filter with CQL. - Select Save changes to keep the filter in the report.
A report grouped by Segment shows shared cost as Unallocated, while a report filtered to a segment includes that segment's share of it. A segment's row in a grouped report is therefore lower than the same segment filtered, by its share of shared cost.
How it behaves
- Rules are evaluated when a report is read. Adding, disabling, reordering or deleting a rule changes what every past month says, not just future ones.
- The first matching rule claims a cost line; nothing is claimed twice.
- Deleting a rule hands the cost it claimed, in every month, to the next active rule in the list that matches it; cost no other active rule matches becomes unallocated.
- A rule added in the console goes after every existing rule. A rule created through the Public API or the Terraform provider takes its place from its
priority, 100 when left out, and a lower priority is evaluated first. - A segment cannot be deleted while a rule still assigns cost to it, a budget measures it, a shared segment's split names it, or a cost report, cost alert or saved filter filters to it, including the report a segment added here arrives with.
- Per pool and currency, every share but the last is rounded to eight decimal places and the last segment of the split takes the rest, so the shares add up to the pool exactly.
- A segment an even or fixed-percentage split names receives its share even in a month it has no direct cost.
- In a report filtered to a segment, each shared cost line counts at the segment's share of the line's pool: for a proportional pool, its share of positive direct cost in the line's billing currency and charge month; for an even or fixed-percentage pool, its fixed fraction. A month in which no segment has positive direct cost leaves a proportional pool unallocated, and a segment whose direct cost is only credits gets no share of it.
- Usage and resource counts of a report filtered to a segment count only the lines assigned to it directly.
- A shared segment cannot be filtered to, because its cost is what the other segments share.