Querying data with SQL
You often want to query the event data that Orb is storing, to better understand attribution to specific dimensions of your event – even if these dimensions aren’t directly relevant to how you bill customers.
Since Orb’s architecture is designed to run aggregation queries over large sets of event data at query time rather than at ingestion time, the product also exposes this capability directly for ad-hoc querying.
For example, you might want to:
- View usage for your compute metric broken down by
cluster_name
, where a user may have hundreds of clusters active in a given time period. - Understand how much a specific transaction contributed to a processing charge by point-filtering to a known
transaction_id
. & Provide more detailed analytics, such as breaking down usage and cost data bybucket_name
anddata_tier
which is included in events you send to Orb. - Build an interactive explorer in your application to view hourly data over a day time range, rather than the default daily views available through Orb’s subscription usage and cost APIs.
- Provide a view into end customer usage by
api_key
prefix, allowing users to understand the source of API requests.
Evaluate Price API
The evaluate price API allows you to leverage multiple SQL expressions in order to dynamically query your data, just as you would use SQL expressions in constructing your metric. The set of filter and grouping expressions need not be configured up-front or known to Orb to pre-aggregate; instead, you’re able to perform these actions on-demand as they become necessary.
Because SQL expressions are supported (as opposed to more basic support for event properties), you can use conditional statements and other logical operators.