curl --request GET \
--url https://api.metronome.com/v1/customers/{customer_id}/billable-metrics \
--header 'Authorization: Bearer <token>'{
"data": [
{
"name": "data transfer (GB)",
"id": "9570e4f3-d1da-4b95-ba81-bd40ee002727",
"group_by": [
"cluster",
"region"
],
"aggregate": "sum",
"aggregate_keys": [
"bytes"
],
"aggregation_type": "SUM",
"aggregation_key": "bytes",
"event_type_filter": {
"in_values": [
"cpu_usage"
]
},
"property_filters": [
{
"name": "cpu_hours",
"exists": true
},
{
"name": "region",
"exists": true,
"in_values": [
"EU",
"NA"
]
},
{
"name": "machine_type",
"exists": true,
"in_values": [
"slow",
"fast"
]
}
],
"group_keys": [
[
"region"
],
[
"machine_type"
]
]
},
{
"name": "CPU hours",
"id": "13117714-3f05-48e5-a6e9-a66093f13b4d",
"aggregation_type": "SUM",
"aggregation_key": "bytes",
"event_type_filter": {
"in_values": [
"cpu_usage"
]
},
"property_filters": [
{
"name": "cpu_hours",
"exists": true
},
{
"name": "region",
"exists": true,
"in_values": [
"EU",
"NA"
]
},
{
"name": "machine_type",
"exists": true,
"in_values": [
"slow",
"fast"
]
}
],
"group_keys": [
[
"region"
],
[
"machine_type"
]
],
"archived_at": "2024-10-01T11:23:44Z"
}
],
"next_page": null
}Get all billable metrics available for a specific customer. Supports pagination and filtering by current plan status or archived metrics. Use this endpoint to see which metrics are being tracked for billing calculations for a given customer.
curl --request GET \
--url https://api.metronome.com/v1/customers/{customer_id}/billable-metrics \
--header 'Authorization: Bearer <token>'{
"data": [
{
"name": "data transfer (GB)",
"id": "9570e4f3-d1da-4b95-ba81-bd40ee002727",
"group_by": [
"cluster",
"region"
],
"aggregate": "sum",
"aggregate_keys": [
"bytes"
],
"aggregation_type": "SUM",
"aggregation_key": "bytes",
"event_type_filter": {
"in_values": [
"cpu_usage"
]
},
"property_filters": [
{
"name": "cpu_hours",
"exists": true
},
{
"name": "region",
"exists": true,
"in_values": [
"EU",
"NA"
]
},
{
"name": "machine_type",
"exists": true,
"in_values": [
"slow",
"fast"
]
}
],
"group_keys": [
[
"region"
],
[
"machine_type"
]
]
},
{
"name": "CPU hours",
"id": "13117714-3f05-48e5-a6e9-a66093f13b4d",
"aggregation_type": "SUM",
"aggregation_key": "bytes",
"event_type_filter": {
"in_values": [
"cpu_usage"
]
},
"property_filters": [
{
"name": "cpu_hours",
"exists": true
},
{
"name": "region",
"exists": true,
"in_values": [
"EU",
"NA"
]
},
{
"name": "machine_type",
"exists": true,
"in_values": [
"slow",
"fast"
]
}
],
"group_keys": [
[
"region"
],
[
"machine_type"
]
],
"archived_at": "2024-10-01T11:23:44Z"
}
],
"next_page": null
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Max number of results that should be returned
1 <= x <= 100Cursor that indicates where the next page of results should start.
If true, the list of metrics will be filtered to just ones that are on the customer's current plan
If true, the list of returned metrics will include archived metrics
Success
Show child attributes
(DEPRECATED) use group_keys instead
A list of keys that can be used to additionally segment the values of the billable metric when making usage queries
Property names that are used to group usage costs on an invoice. Each entry represents a set of properties used to slice events into distinct buckets.
(DEPRECATED) use aggregation_type instead
(DEPRECATED) use aggregation_key instead
(DEPRECATED) use property_filters & event_type_filter instead
A key that specifies which property of the event is used to aggregate data. This key must be one of the property filter names and is not applicable when the aggregation type is 'count'.
An optional filtering rule to match the 'event_type' property of an event.
Show child attributes
A list of event types that are explicitly included in the billable metric. If specified, only events of these types will match the billable metric. Must be non-empty if present.
A list of event types that are explicitly excluded from the billable metric. If specified, events of these types will not match the billable metric. Must be non-empty if present.
A list of filters to match events to this billable metric. Each filter defines a rule on an event property. All rules must pass for the event to match the billable metric.
Show child attributes
The name of the event property.
Determines whether the property must exist in the event. If true, only events with this property will pass the filter. If false, only events without this property will pass the filter. If null or omitted, the existence of the property is optional.
Specifies the allowed values for the property to match an event. An event will pass the filter only if its property value is included in this list. If undefined, all property values will pass the filter. Must be non-empty if present.
Specifies the values that prevent an event from matching the filter. An event will not pass the filter if its property value is included in this list. If null or empty, all property values will pass the filter. Must be non-empty if present.
The SQL query associated with the billable metric
RFC 3339 timestamp indicating when the billable metric was archived. If not provided, the billable metric is not archived.
Specifies the type of aggregation performed on matching events.
count, Count, COUNT, latest, Latest, LATEST, max, Max, MAX, sum, Sum, SUM, unique, Unique, UNIQUE