We currently use cookies to improve and customize your experience on our site. If you accept, we’ll also use marketing cookies to show you personalized ads. Manage your cookies and learn more.
MetricBase
namestringOptional
Descriptive name of the metric that represents a pricing component of your application. This is primarily used for display purposes in the user interface.
codestringOptional
Unique code used to identify the metric within your system. This code is used in API requests to associate events with the correct metric and must be unique across all metrics. Once created, this code cannot be changed.
Type of metric, either 'metered' for usage-based or 'recurring' for fixed periodic charges.
Default"RECURRING"Value in"METERED" | "RECURRING"
descriptionstringOptional
Optional detailed description of the metric that provides additional context about what the metric measures and how it's used. This information is for internal use and helps document the purpose of the metric.
Value in"COUNT" | "SUM" | "MAX" | "COUNT_DISTINCT" | "LATEST"
aggregation_fieldstringOptional
Property name within the event payload that will be used for aggregating usage data. This field specifies which value from the event should be used for calculations. It is required for aggregation types like 'SUM', 'MAX', and other types that operate on values, but not required for 'COUNT' aggregation.
field_filtersobject<object>[]Optional
object properties
2 properties
keystringRequired
Property name within the event payload that will be used for filtering. This allows you to segment usage data based on specific event properties, such as region, tier, or any other dimension you track.
valuesarray<string>Required
Array of specific values that the system should match against the filter key. Only events with matching key-value pairs will be included in the metric calculations. This enables differentiated pricing based on dimensions like region, environment, or other custom properties.