Creating billable metrics is the first step in setting up your pricing on Lotus.
metric_name
(display name
for your metric) and event_name
, the name of events that will be used to
calculate the metric. For more details about how to log events and how to pass
in an event name, please refer to the Logging Events
section.
Next, define the aggregation type. To pick an aggregation type, think about how
you want to pass in usage information as events into Lotus. Many of the
aggregation types depend on you passing in certain key/value pairs in the
properties.
The allowed aggregation metrics are:
COUNT
UNIQUE
:property field required
SUM
:property field required
MAX
:property field required
proration
field. The allowed values for proration
are second
, minute
, hour
, day
, month
, quarter
, and year
. The proration fieldis a way for you to allow for “fair” pricing.
For example, Notion’s pricing states:
proration
to day
, and we would automatically
take care of the rest.
event_name
and metric_name
. Additionally, you’ll need to specify the granularity
of the metric, which determines the size of the subperiods to track your metric over. The allowed granularities for rate metrics are minute
, hour
, day
and month
.
For example, you may have a metric that tracks the number of rows inserted into your database. If you only wanted to allow a certain number of database inserts per hour, you would set the granularity
to hour
.
The aggregation within the subperiod works the same way as counter metrics. To calculate whether a customer has exceeded their rate limit, you must specify an aggregation_type
. The allowed values are COUNT
, SUM
, and MAX
(UNIQUE
is not supported at this time).
generate_text
. At the end of the billing period, we will take the COUNT
of events with this name. That will be a customer’s usage for the billing period. We will later define how to transform that usage quantity into a price, specifically when creating plan components.
DELTA
events, which means we are tracking the change in the number of active seats. We are also using the day
proration, which means we will prorate the price based on the number of days of the billing period the seat was active.