Unit Economics
Divide your AWS spend by a business metric to see cost per user, per API call, or per transaction — and whether cost is scaling efficiently.
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.
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.
Provide the values
- Manual: use the date + count form to enter a value for each day you want to track. 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 …).
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.
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 |
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.
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.
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.