The Metering Flow
Meters
A Meter defines:- What to measure (property name in event payload)
- How to aggregate (SUM, MAX, UNIQUE_COUNT, LAST)
- Unit for display (calls, bytes, users, etc.)
meter_token — a UUID used to identify it when sending events.
Usage Events
Each usage event contains:Querying Usage
View aggregated usage for a meter:Grouping Options
group_by | Description |
|---|---|
hour | Hourly breakdown |
day | Daily breakdown (default) |
week | Weekly breakdown |
month | Monthly breakdown |
Idempotency
To prevent double-counting when retrying failed requests, always pass anidempotency_key:
idempotency_key is sent again, the duplicate event is silently ignored.
High-Volume Ingestion
For high-volume scenarios (millions of events/day), consider:- Batching events — Aggregate at your backend before sending (e.g., send message count every minute, not per message)
- Async sending — Use a message queue to send events asynchronously
- Pre-aggregation — Use your own counters and periodically sync totals
See the Infrastructure Cost Guide for scaling recommendations.