Skip to main content
Latest measures the last reported value of an event property in the billing cycle. Lago uses the value with the latest event timestamp. Use it when your application reports a current value and you want the last reading, rather than a total of all readings.
Diagram of the Latest aggregation, keeping the value of the most recent event

Latest calculation method

Configure the metric

Set field_name to the event property you want to measure. Set recurring to false. This aggregation does not support carrying the quantity into the next billing cycle. Lago resets the measured quantity at the end of each cycle.

Create the metric

  1. Go to Billable metrics in the side menu.
  2. Create a new billable metric.
  3. Enter a name, a code and an optional description.
  4. Select Latest as the aggregation type.
  5. Select the event property you want to measure.
  6. Add filters if you want to group usage by dimensions such as region or provider.
  7. Click Add billable metric.

Calculation example

The two example events below belong to contract_example and the same billing cycle. Their timestamps are January 16 and 17, 2027 at 00:00 UTC.
Event 1
Event 2
The first event reports 20 and the later event reports 10. Lago uses the later reading, so the measured quantity is 10.

Aggregation examples

Compare how aggregation types calculate usage.

Metered products

Connect your metric to a Product.

Create a billable metric (API)

POST /billable_metrics

Ingest usage

Send usage events to Lago.