Skip to content
Tessera
All posts

Engineering7 min read

Designing a meter: what to count, and what to leave out

A good meter maps to the value a customer feels, survives retries and is boring to audit. Here is the checklist we use with every new customer.

Lena BrandtFounding Engineer

Every usage based business eventually discovers that the meter is the product. Customers do not read your pricing page twice, but they read every invoice. If the thing you count does not match the value they feel, no amount of discounting will fix the conversation.

Start from the value, not the log line

The easiest meter is whatever your service already logs: requests, rows, seconds of compute. The best meter is the unit your customer would use to describe their own success.

ProductEasy meterBetter meter
Email APIAPI callsEmails delivered
Vector databaseQueriesStored vectors, plus queries above a free allowance
Video platformBytes egressedMinutes watched

A better meter is usually a little harder to compute. That cost is paid once by you instead of every month by your customer.

If a customer cannot predict next month's bill from their own dashboard, the meter is wrong.

Four properties of a meter that lasts

  1. Monotonic. It only goes up within a period, or it is a gauge you sample at a fixed time.
  2. Idempotent. Every event has a key, so retries never double count.
  3. Attributable. Each event names a customer and, ideally, a project or seat inside that customer.
  4. Replayable. You keep the raw events long enough to rebuild any invoice from scratch.

What it looks like in code

await tessera.events.ingest({
  customer: "cus_8f2a",
  meter: "emails.delivered",
  value: 1,
  idempotencyKey: message.id,
  timestamp: message.deliveredAt,
});

The idempotency key is the message id, not a random value. That way the same delivery reported by two workers still counts once.

What to leave out

  • Internal retries. Count the outcome, not the attempts.
  • Free actions. If you will never charge for it, do not meter it. It only adds noise to the invoice.
  • Anything you cannot explain in one sentence. If support cannot explain it, sales will discount it.

Pick one meter, ship it, and add a second only when a real customer asks why two very different workloads cost the same.

§ 07Get started

Ship the pricing page you actually want.

Free until you bill $10k a month. Most teams send their first real invoice within two weeks.