Understanding billable metrics in Orb

Last updated: September 13, 2024

What are billable metrics in Orb?

In Orb, a billable metric defines how usage events are aggregated to calculate customers' charges. It’s a way to turn raw usage data into a quantity you can bill for. As new usage events stream into Orb, billable metrics continuously update, allowing you to track customer usage in real-time easily.

How do billable metrics filter usage?

When creating a billable metric in Orb, you must specify filters to decide which events will be included in the calculation. Orb offers a no-code tool to create AND/OR statements based on event properties to set these filters easily.

How do billable metrics aggregate usage?

After setting the filtering rules for the billable metric, the next step is to choose how to aggregate the filtered events. Orb’s no-code tool offers several built-in aggregation options: count, unique, sum, max, min, and average. If you need more customized aggregations, you can create them using custom SQL.

Can billable metrics be defined using SQL?

If you want to define a more complex metric than Orb's no-code tool allows, you can write billable metrics in custom SQL. Orb can also convert a standard non-SQL billable metric into SQL anytime.

How are billable metrics used in Orb?

When creating a plan in Orb, you can include usage-based pricing. This type of pricing uses a specified billable metric to determine the quantity of usage to charge the customer.

To begin creating billable metrics, check out our quickstart guide.