Computed properties
The Orb web interface allows you to specify a SQL clause when properties of the original events do not suffice to assemble your metric. For example, you might want to multiply a property by a constant factor, combine two properties of the event, or use a function likeCOALESCE
to handle null
values. When composing your billable metric with a computed property, Orb shows you a preview of the computed property across the events displayed.
SQL support
Traditional billing systems support a rigid set of operators over the reported metric, such asLAST
or MAX
, not allowing you to perform sophisticated transforms or usage calculations.
Orb is designed to be extensible at its core, and allows you to define metrics fully in SQL. Orb’s SQL engine runs in real-time over your reported events stream, while still providing you SQL syntax support. SQL queries run over the entirety of events in the billing period, and not just an incremental slice of reported events, so you never have to worry about keeping track of intermediate stream state.
For example, customers use Orb’s SQL metrics layer to:
- Use
CASE
statements and conditionals to construct sophisticated compute units that bill differently for each event. - Use sub-queries for more sophisticated aggregations, such as calculating average volume over the month excluding the top n days of usage.
- Transform and scale event properties before they are used for billing purposes.