Cloud cost per customer in a SaaS product has two parts: the cost that demonstrably serves only that customer, and a share of shared cost, split by a measured usage driver. A defensible number needs no complete tag coverage, just a written cost basis, a justified driver and a visible remainder. Below: three attribution methods, a formula, a SQL sketch for FOCUS data and the checks to run before pricing on it.
Write the definition down first
An average (total cost divided by active customers) shows a trend. Pricing tiers, large contracts and architecture decisions need each customer's cost. Fix these before the first query:
| Component | Recommended choice |
|---|---|
| Cost basis | FOCUS EffectiveCost: amortised, after discounts; excluding tax, credits and adjustments |
| Scope | Only the production accounts, subscriptions or projects that serve customers |
| Period | Closed calendar month in UTC with a recorded data cut |
| Denominator | Customer ID as the product records it, including internal and test tenants |
| Remainder | Unallocated cost as its own line, never spread silently |
Keep credits out. AWS applies promotional credits automatically to the largest eligible service charges, not to the customer who caused the cost, so they lower the number without changing the cost structure. Show them separately. Which AWS export carries the columns you need is covered in CUR 2.0 or FOCUS.
Three ways to attribute cost to a customer
Most SaaS products use all three, in this order, because each step shrinks the pool for the next.
1. Dedicated resources per customer
If a customer runs in its own AWS account, Azure subscription or Google Cloud project, attribution is a filter on SubAccountId. The AWS Well-Architected SaaS Lens calls this the silo model: dedicated resources, but shared identity, onboarding and operations. Those shared parts, such as the control plane, central logging and the build pipeline, belong in the shared pool.
2. Tagged resources in shared accounts
A bucket, queue or database instance per customer inside a shared account gets a tag such as tenant. In AWS the key reaches cost data only once it is activated under Cost allocation tags in the Billing and Cost Management console. AWS states up to 24 hours for a new key to appear there and up to another 24 hours for activation. For past months the management account can request a backfill of up to twelve months, but only for resources that already carried the tag at the time. How labels are read from the Google Cloud export is shown in the guide to the BigQuery billing export.
3. Proportional to a usage driver
Whatever customers use together is split by a driver: API requests, stored gigabytes, processed jobs or seats. The SaaS Lens describes two steps: measure each tenant's share of consumption, then correlate that share with cost from the bill. In a pooled architecture the bill does not know your customers; the driver comes from your application.
Choose the driver
A driver is usable when it meets four conditions:
- It moves the cost. When the driver rises, the pool's cost rises. Seats rarely move compute cost; requests rarely move storage cost.
- It is counted per customer. The figure comes from product data keyed by the same customer ID as the tag, not from an estimate.
- It covers the same period. FOCUS requires timestamps in UTC. If your application counts in Europe/London or Europe/Berlin local time, the month boundary shifts by the offset.
- It is worth measuring. The SaaS Lens suggests measuring consumption where most of the bill arises.
| Driver | Fits | Distorts when |
|---|---|---|
| API requests | Stateless compute behind a gateway | Requests differ widely in cost, such as an export versus a status check |
| Stored GB | Databases, object storage, backups | Compute dominates the pool |
| Jobs or CPU-seconds | Workers, batch, queues | Jobs are only counted but run for very different durations |
| Seats | Cost that arises per person | It is used to replace an infrastructure driver |
One named driver for the whole pool is an acceptable first version. Once a component such as the database dominates the pool, give it its own key.
Separate shared cost from unallocated cost
After direct cost, two remainders are left, and they should not be mixed:
- Shared production pool: resources that clearly serve customers but belong to none of them, such as the shared database cluster. Mark them with a tag such as
cost_pool=shared-prodor a dedicated account. This pool is split by the driver. - Unallocated: cost with neither a customer tag nor a pool marker. It stays on its own line until resolved; spreading it rewards missing tags.
The FinOps Framework™ moves unit economics from direct variable cost to fully loaded cost as maturity grows. Report two values: cost per customer from direct and allocated production cost, and the same including central platform cost. The glossary entry on unit economics defines the term.
The formula
For customer k in month m:
Cost(k) = Direct(k) + Pool × Driver(k) / Driver(all)
Direct(k) sum of EffectiveCost with tenant = k
Pool sum of EffectiveCost with cost_pool = shared-prod and no tenant
Driver(k) measured usage of k in the same month
Driver(all) usage of all tenants, internal and test tenants included
Remainder all other cost in scope
The completeness check is: the sum of all Cost(k) plus the remainder equals total cost in scope. If internal tenants are missing from the denominator, paying customers absorb their share and every customer looks more expensive than it is.
SQL sketch: join FOCUS cost with usage data
The sketch assumes an AWS export in FOCUS 1.2 format queried with Amazon Athena (focus_export) and a monthly table from your application (product_usage with month, tenant_id, api_requests). Adjust table, account and tag names.
WITH cost AS (
SELECT date_trunc('month', chargeperiodstart) AS month,
element_at(tags, 'tenant') AS tenant_id,
element_at(tags, 'cost_pool') AS cost_pool,
effectivecost
FROM focus_export
WHERE chargecategory IN ('Usage', 'Purchase')
AND subaccountid IN ('{prod_account_a}', '{prod_account_b}')
),
direct AS (
SELECT month, tenant_id, SUM(effectivecost) AS direct_cost
FROM cost
WHERE tenant_id IS NOT NULL
GROUP BY 1, 2
),
pool AS (
SELECT month,
SUM(CASE WHEN cost_pool = 'shared-prod' THEN effectivecost ELSE 0 END) AS shared_cost,
SUM(CASE WHEN cost_pool = 'shared-prod' THEN 0 ELSE effectivecost END) AS unallocated_cost
FROM cost
WHERE tenant_id IS NULL
GROUP BY 1
),
usage AS (
SELECT month, tenant_id, api_requests,
SUM(api_requests) OVER (PARTITION BY month) AS all_requests
FROM product_usage
)
SELECT COALESCE(u.month, d.month) AS month,
COALESCE(u.tenant_id, d.tenant_id) AS tenant_id,
COALESCE(d.direct_cost, 0) AS direct_cost,
COALESCE(p.shared_cost * u.api_requests / NULLIF(u.all_requests, 0), 0) AS shared_share,
p.unallocated_cost AS month_unallocated
FROM usage u
FULL OUTER JOIN direct d ON d.month = u.month AND d.tenant_id = u.tenant_id
LEFT JOIN pool p ON p.month = COALESCE(u.month, d.month)
ORDER BY 1, 2;
Three details decide the result:
- The
FULL OUTER JOINkeeps customers visible who incur cost but are missing from the usage data. That points to a tag or ID error. - The tag value must match the product's
tenant_idexactly, including case, andproduct_usage.monthmust have the same type as the result ofdate_trunc. - If
tagsis JSON text rather than a map in your table, usejson_extract_scalar(tags, '$.tenant'); ifchargeperiodstartis text, wrap it infrom_iso8601_timestamp.
Check the result before it carries a pricing decision
- Completeness. Sum of
direct_costplus sum ofshared_shareplusmonth_unallocatedequals the monthly total ofcost. If not, usage rows are missing or the denominator is zero. - Match the cost report. The monthly total equals the same view in your cost tool: same basis, accounts and data cut.
- Read the outliers. High direct cost with zero usage points to a wrong tag; high usage with almost no cost points to a driver that misses this customer's expensive operations.
- Run a second driver. Split the pool once by storage instead of requests. If the ranking of the most expensive customers changes, the choice of driver is the decision. Report both values as a range.
- Explain the movement. Break the change against the previous month into direct cost, pool cost and driver share, as the bridge in the monthly cloud cost review describes.
- Judge the remainder. If the unallocated amount is large relative to the differences between customers, use the number for trends, not yet for pricing.
What Costfluent covers
Costfluent reads billing data from AWS, Azure and Google Cloud through read-only connectors and shows cost by account, service, resource and tag, including a tenant tag. Allocation rules assign cost to a segment by account or subscription, resource group, resource name or tag. Cost marked as shared is spread in proportion to the segments' direct cost, and anything no rule matches stays visible as unallocated. Tag coverage shows what share of cost carries a key. Costfluent does not ingest product usage metrics such as requests or seats; the usage-driver step runs in your data warehouse, using report rows from the CSV export or the Public API. More on cost allocation. For clusters several customers share, see Kubernetes cluster cost.
Sources and method
Checked on 2026-10-10. AWS SaaS Lens: Silo, Pool and Bridge Models, AWS SaaS Lens: Expenditure awareness (SaaS COST 1 and 2), AWS: Activating user-defined cost allocation tags, AWS: Backfill cost allocation tags, AWS: Applying AWS credits, FOCUS 1.2: EffectiveCost, FOCUS 1.2: ChargeCategory, FOCUS 1.2: Date/Time Format, FinOps Foundation™: Unit Economics and FinOps Foundation: Allocation. The definition, formula, SQL sketch and checks are Costfluent recommendations, not pricing or accounting advice.



