Unit Economics
Divide your AWS spend by a business metric — active users, API calls, transactions — to see whether cost is scaling efficiently as you grow.
Rising AWS spend isn't automatically a problem — if your business is growing faster than your bill, you're actually becoming more efficient. Raw spend can't show you that; unit economics can. It divides your spend by a business metric to answer the question product, engineering, and finance leaders really care about:
Is our infrastructure cost scaling efficiently as we grow?
CostLens overlays your cost-per-unit (for example cost per active user, per API request, or per transaction) on top of your total spend, so the trend that matters stands out.
Where to find it
Open Billing, then scroll to the Unit Economics section. Viewing is available to every role; adding or editing a metric's data source is admin-only.
Why it matters
| What you see | What it means |
|---|---|
| Spend ↑ but cost-per-unit ↓ | Healthy — you're scaling faster than cost (economies of scale) |
| Spend flat but cost-per-unit ↑ | Creeping inefficiency or waste worth investigating |
| Both ↑ together | Cost is outpacing growth — dig in |
Example. Your spend rises from $30,000 to $36,000 (+20%) and looks alarming on the billing chart. But your active users went from 10,000 to 15,000 — so your cost per user actually dropped from $3.00 to $2.40. Unit economics turns a scary-looking spend increase into a clear "we got more efficient" story — and just as importantly, flags the opposite case (spend +10% while users stay flat) that a spend-only chart hides.
Setting up a metric
You'll find Unit Economics on the Billing page. You can track as many metrics as you like, and each is private to your organisation.
Open the Unit Economics section
Go to Billing and scroll to Unit Economics. Use the account selector at the top of the page to choose whether the metric is divided into a single account's spend or your whole organisation's total.
Add a metric
Click Add metric (admin only) and give it a name (e.g. "Active users") and a unit label — the word after "cost per", such as user. Then choose a data source:
- Manual entry — best when the number lives in a spreadsheet or BI tool.
- HTTP endpoint — CostLens polls a URL that returns the number once a day.
- CloudWatch (zero setup) — CostLens reads a demand metric (ALB / API Gateway / Lambda / CloudFront request counts) straight from your connected account's CloudWatch. No spreadsheet, no endpoint.
Provide the values
- Manual: use the date + count form to enter a value for each day you want to track, or click Import CSV to bulk-load history from a file. Cost-per-unit appears for every day that has a value.
- HTTP endpoint: paste a URL that returns the metric as a number. If the response is JSON, add a JSON path (for example
data.value). If the endpoint needs authentication, add an auth header name and value (for exampleAuthorization/Bearer …). - CloudWatch: pick the account and region, click Discover metrics, and choose the proxy that best represents real demand on your infrastructure (for example your main ALB's request count). CostLens backfills ~30 days immediately and then refreshes daily — so the chart is useful straight away.
Read your chart
The chart shows total spend (area, left axis) with your cost-per-unit line (right axis) for the selected account and date range. Switch between metrics with the dropdown.
Aevi's analysis
Above the chart, Aevi (Aezona's AI-powered assistant, built into CostLens) reads the same data and tells you what it means:
- A one-line verdict and trend chip — efficient scaling (spend up but cost-per-unit flat or down) versus inefficiency (cost-per-unit climbing), with the percentage change.
- The likely driver of the movement, named from your actual spend (for example "NAT Gateway data processing"), so you're not guessing.
The card stays focused on the unit-economics signal. To act on what Aevi finds, head to the Recommendations page or the Aevi Insights workspace, where the specific fixes (and their savings) live.
Aevi's analysis refreshes automatically and is cached for ~30 minutes; use the refresh icon to regenerate it on demand.
Anomaly markers
Days where your cost-per-unit broke its normal pattern are flagged with a rose marker on the line (hover for "⚠ Unusual unit cost — broke trend"). Detection runs on cost-per-unit — the efficiency metric — not raw spend, so it surfaces genuine inefficiency rather than healthy growth. Aevi calls out these days in its summary too.
Data sources
| Source | How it works | Best for |
|---|---|---|
| Manual entry | You enter a value per day directly in CostLens | Metrics tracked in a spreadsheet, a BI dashboard, or anywhere without an API |
| HTTP endpoint | CostLens calls your URL once a day and records the number it returns | Metrics you can expose over HTTP — e.g. Datadog, Amplitude, or your own internal endpoint |
| CloudWatch (zero setup) | CostLens reads a demand metric (ALB / API Gateway / Lambda / CloudFront request counts) from your account's CloudWatch via the existing role, backfilling ~30 days | The fastest way to start — a usable per-request unit cost with no spreadsheet or endpoint to maintain |
You need recent billing data
The cost side of the calculation uses your daily AWS spend, so the account must be connected and synced. If you've just added an account, give it a sync first. See AWS Accounts and Billing & Costs.
HTTP endpoints must be public and return a number
For security, CostLens only calls public, internet-reachable URLs — internal, private, and loopback addresses are blocked. The endpoint should return a plain number (or JSON with a path to one). It's polled once a day, and AWS cost data itself can lag up to ~24 hours, so the most recent day may be partial. If a poll fails, the section shows the last error so you can fix the URL or credentials.
Required IAM permissions
CloudWatch-sourced metrics need read access to the metric data in the account/Region you point at:
cloudwatch:ListMetrics
cloudwatch:GetMetricStatistics
Already included in the CostLens IAM policies from AWS Accounts — no extra setup needed to use CloudWatch as a source on an account you've already connected.
Who can do what
Configuring a data source (the URL and any secret) requires an admin role, and any stored secret is encrypted and never shown again. Viewing the chart and adding manual values are available to everyone in the organisation. See Roles & Permissions.
Multiple AWS accounts
If you've connected several accounts (often 10–20), you can decide exactly which accounts each metric measures — on both sides of the division.
Spend scope (the numerator). When adding a metric, choose a Spend scope:
- All accounts (default) — cost-per-unit uses your total spend across every connected account. This is the company-wide "blended cost per X", and it stays complete automatically as you connect more accounts.
- Choose accounts — pick one account (true per-account unit economics) or a set of accounts (a segment, e.g. a business unit or environment). Cost-per-unit then uses just those accounts' summed spend. A metric's own scope always wins over the Billing page's account selector, so a scoped metric reads the same wherever you view it.
Cross-account CloudWatch (the denominator). A CloudWatch metric can aggregate demand across accounts: in the Discover step, pick a proxy in one account and Add it, then switch account/region and add another. CostLens sums the daily values across all the sources you add — useful when your traffic is spread over, say, one ALB per account. The card shows how many accounts are aggregated.
Pair the two sides sensibly
For genuine per-account or per-segment unit economics, scope the spend to the same accounts whose demand you're measuring. For example: spend scope = your three production accounts, denominator = the request counts from those same three accounts.
Per-customer / per-team attribution
Beyond whole-account scoping, you can measure the unit economics of one customer, team, or feature by attributing cost with a cost allocation tag.
When adding or editing a metric, choose Choose accounts for the spend scope, then under Attribute cost by tag pick a tag key (e.g. Customer) and value (e.g. Acme). Cost-per-unit then uses only the spend of resources tagged that way — so you can track, for example, your cost to serve each customer.
Activate the tag first
Tag attribution reads from AWS Cost Explorer, so the tag must be activated as a Cost Allocation Tag in the AWS Billing console (and applied to your resources). CostLens lists the tag keys and values it finds; if none appear, the tag isn't activated yet. Results are cached for a few hours.
Pair the denominator to the segment
Attributing cost to Customer=Acme is most meaningful when the denominator also reflects Acme — e.g. Acme's active users — rather than your whole user base.
The denominator itself stays org-wide
Scoping the spend side to an account, segment, or tag doesn't scope the usage metric the same way — business metric values are stored per calendar day, not per account or customer. Pairing the denominator to the segment (above) is about choosing a metric that reflects the segment (e.g. Acme's own user count), not about CostLens automatically splitting one metric's values across segments.
Targets & alerts
Set a target cost per unit on any metric and turn on alerting. CostLens checks daily and notifies you when:
- the latest cost-per-unit exceeds your target, or
- cost-per-unit breaks its trend (an efficiency regression), even if you haven't set a target.
Alerts appear in your in-app Notifications and are de-duplicated so you get at most one per metric per day. Set the target and toggle when adding a metric, or later via Edit.
Managing metrics & values
- Edit (admin) — rename a metric, change its unit label or spend scope, set targets/alerts, or pause polling, without losing history.
- Values — review every stored day in a table, delete a bad day, or export the series to CSV. To correct a value, re-enter it for the same date (it's overwritten).
- Refresh (admin) — for HTTP and CloudWatch metrics, re-read the source on demand instead of waiting for the daily poll. New HTTP and CloudWatch metrics are also read immediately on creation, so the chart isn't empty on day one.
Tips
- Pick a metric that reflects real demand on your infrastructure — active users, API requests, or completed transactions usually tell the clearest story.
- Compare cost-per-unit across the same date range as a spend spike: if spend rose but cost-per-unit fell, that's healthy growth, not waste.
- Add more than one metric (e.g. cost per user and cost per transaction) to see efficiency from different angles.
- Pair this with Cost Forecast to anticipate where both spend and unit cost are heading.
- Already have history in a spreadsheet? Use Import CSV on any metric to load months of daily values at once — two columns: date (YYYY-MM-DD) and value. CSV, TSV and semicolon-separated files all work.