Skip to main content
A meter is the rule that turns raw events into a usage total. It chooses which events count, optionally narrows them through metadata filters, and applies an aggregation such as count or sum. Examples:
  • Match ai_usage and sum total_tokens to bill for model consumption.
  • Match video_streamed and sum duration to charge by viewing time.
  • Match file_uploaded and sum size to price storage intake.
Create meters from the dashboard. Ruba maintains both organization-wide and per-customer totals, so the same definition can power billing, customer balances, and usage reporting.

Building a Meter

Open Products → Meters and choose Create Meter. A meter has two jobs: decide which events belong, then reduce them into one quantity.

Filters

A filter combines one or more clauses. Only events satisfying the resulting expression reach aggregation.

Build each clause

Choose an event property, an operator, and the comparison value. Metadata keys are referenced directly; do not prefix them with metadata.. Operators are equals, not equals, greater than, greater than or equals, less than, less than or equals, contains, and does not contain. The builder interprets values in this order: number, boolean (true or false), then string.

Join clauses

Use and when every clause must match. Use or when any one match is sufficient.

Aggregation

After filtering, choose the reduction: For four events whose total_tokens values are 10, 20, 30, and 30, the outputs are Count 4, Sum 90, Average 22.5, Minimum 10, Maximum 30, and Unique 3.

Unit

The unit changes display formatting on checkout, invoices, and the portal; it does not change calculation. For a custom unit, the label supplies the singular name and the multiplier scales only the displayed denomination. A multiplier of 1,000 can show a price per thousand while unit_amount remains the price of one raw unit.

Example

A meter may select events named openai-usage and sum their completionTokens metadata value. Use Preview during creation to inspect the events the filter accepts.

Operating rules

Filters and aggregation may be changed only while the meter has neither processed events nor a customer purchase attached to it.