Group keys
to organize your metric data.Group keys
are used in Metronome to specify one or more properties that can be used to break out usage in downstream pricing and packaging. This functions similarly to a group by
clause in a SQL query. Group keys must first be defined in the metrics layer in order to be available to use in downstream pricing and packaging. A given billable metric can have many group keys.
Group keys help support the following use cases in the platform:
user_id
as a group key, you can display usage on an invoice broken out by each user_id
. This is useful for attributing spend across a larger organization.[cloud_service_provider, region]
as a group key, you can set up separate rates for events with different values of this property.
cloud_service_provider=aws
and region=us-east-1
are priced at $0.50cloud_service_provider=azure
and region=southindia
are priced at $0.40user_id
and pricing group key on [cloud_service_provider, region]
, create a group key on the billable metric that looks like [user_id, cloud_service_provider, region]
.
Exists
or In
filter. Group keys are not editable once a metric is created, so it is important to consider if they are needed for your invoice presentation or pricing when creating your billable metrics.
value
column can be used as a group key. For example, to use the property user_id
as a presentation group key, and region
as a pricing group key, your SQL query may look like:
transaction_ids
. The response contains the list of matched billable metrics, as well as the matched customer if it exists. If you’ve set up a matching customer and matching billable metric, but do not see these values populated, you can dig into the billable metric definition to see if anything is incorrectly defined.