- Commit and Credit threshold notifications monitor remaining balances of commits or credits. They can be used to notify a customer when they’ve used 90% of their commit, or to flag accounts that are close to running out of prepaid credits.
- Spend and Usage threshold notifications track how much a customer has spent or used over a given billing cycle. They can be used to trigger a message when a customer crosses a spend threshold, such as $5,000, or to power logic for offering upgrades once a customer approaches a certain usage cap.
- Invoice threshold notifications monitor invoice totals after commits and credits have been applied to customer spend. They can be used to proactively notify customers when spend surpasses pre-configured budgets.
Threshold notification types
Commit & Credit Notifications
Commit & Credit Notifications
Contract credit balance
Alert Type:alerts.low_remaining_contract_credit_balance_reached
Triggers when a customer’s credit balance reaches or drops below a set amount. If multiple credits exist for a customer, Metronome sums up the remaining balances across all credits to compare against the threshold.To notify on a specific credit, set a custom field on the credit in Metronome and use advanced filters to evaluate only credits with that specific custom field value.Contract credit percentage
Alert Type:alerts.low_remaining_contract_credit_percentage_reached
Triggers if the customer’s percentage of available credits on all active credits of that credit type (currency or pricing unit) reaches or goes below a set threshold.To notify on a specific credit, set a custom field on the credit in Metronome and use advanced filters to evaluate only credits with that specific custom field value.Commitment balance
Alert Type:alerts.low_remaining_commit_balance_reached
Triggers when a customer’s commit balance reaches or drops below a set amount. If multiple commits exist for a customer, Metronome sums up the remaining balances across all commits to compare against the threshold.To notify on a specific commit, set a custom field on the commit in Metronome and use advanced filters to evaluate only commits with that specific custom field value.Commitment percentage
Alert Type:alerts.low_remaining_commit_percentage_reached
Triggers if the customer’s percentage of available commits on all active commits of that credit type (currency or pricing unit) reaches or goes below a set threshold.To notify on a specific commit, set a custom field on the commit in Metronome and use advanced filters to evaluate only commits with that specific custom field value.Contract credit and commit balance
Alert Type:alerts.low_remaining_contract_credit_and_commit_balance_reached
Triggers when a customer’s combined commit and credit balance reaches or drops below a set amount. If multiple commits and credits exist for a customer, Metronome sums up the remaining balances across all commits and credits to compare against the threshold.Spend & Usage Notifications
Spend & Usage Notifications
Spend threshold
Alert Type:alerts.spend_threshold_reached
Triggers if the customer’s usage-based spend prior to commit and credit drawdown for their current billing period reaches or goes beyond the set threshold. This notification evaluates against the sum of all usage-based charges for a particular customer, including usage drawdowns on credits and commits.Credit and commit purchases are not factored into a customer’s spend threshold notification. For example, if the threshold is set at $10,000, an actual billing spend of $7,000 plus a credit purchase of $3,000 does not trigger the notification.Additionally, spend notifications are evaluated only against direct spend in a specific credit type. A spend notification threshold configured for a currency always evaluates to ok
if you are using a custom pricing unit for a customer’s line items. To avoid this, configure spend notification thresholds to use the same pricing unit as the line items on a customer’s invoice.To notify on a specific contract type, set a custom field on the contract in Metronome and use advanced filters to evaluate only contracts with that specific custom field value.Optionally, use the group_values
advanced filter parameter with this notification type to evaluate only usage associated with a specific group key:group value pair.Billable metric usage
Alert Type:alerts.usage_threshold_reached
Triggers if the customer’s usage of a particular billable metric in their current billing period reaches or goes beyond your set threshold.The current billing period for a customer is calculated by taking the earliest start date and the latest end date across all active invoices.Invoice Notifications
Invoice Notifications
Invoice total
Alert Type:alerts.invoice_total_reached
Triggers if any of the customer’s active invoices reaches or exceeds the configured threshold. This notification evaluates against the net invoice total after any credits, commits, or other adjustments have been applied. Each active invoice for the customer is evaluated separately. Additionally, only invoices in the specified currency are evaluated.To notify on a specific invoice type, use advanced filters to target the particular invoice type.Webhook payload examples
Creating and managing threshold notifications
Threshold notifications can be created and managed through both the UI and the API. You can define what thresholds you care about and which customers to target.
- Navigate to the Notifications tab
- Click Create Notification
- Choose any of the above threshold notification types
- Configure threshold details and custom field level targeting where applicable
- Determine whether you’d like the notification to evaluate customers that already meet the threshold or only trigger on customers that cross the threshold in the future
- Select customers that notification should be applied to
- Click Save
- Metronome will begin evaluating the selected customers against the defined threshold and will trigger a notification to your configured webhooks when the customer crosses the threshold
- Ensure your webhooks are set up to properly handle the payloads for these notifications
- Call
POST /v1/alerts/create
- Pass in the alert type, name and threshold in the request body
- Optionally pass in additional filters relevant to the alert type
- A successful response will return a CustomerAlert object containing the notification configuration with its unique ID and current status
POST /v1/customer-alerts/get
endpoint. This endpoint provides instant visibility into whether a customer has triggered a threshold condition, enabling you to monitor account health and take proactive action based on current state. This endpoint is useful for periodic checking of a customer’s threshold notification status, but shouldn’t be scraped. You should instead rely on the webhook notification to understand when customers are moved to IN_ALARM
.
Threshold notifications can be archived in the UI or via API, removing them from active monitoring.
Threshold notification evaluation triggers
To assess whether or not a threshold notification should be sent, Metronome routinely evaluates customers with associated notifications in real time as usage is sent to Metronome. If a customer’s watched value—credit balance, spend, and so on—hits the threshold, a threshold notification is sent. There are two possible triggers for an evaluation:- Usage events are ingested
- Customer metadata changes (for example, a contract is assigned or a new ingest alias is assigned) Specifically, any CRUD (create, retrieve, update, and delete) action impacting notifications, customers, customer ingest aliases, contract, commitments, and credits are considered metadata changes and trigger a notification evaluation.