Threshold notifications monitor real-time metrics and trigger when defined thresholds are crossed. They’re best for proactive monitoring and usage-driven workflows. Threshold notifications fall into three main categories:
  • 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

Webhook payload examples

{  
  "id": "445b849e-1366-4580-a6cc-f488e27c059f",  
  "properties": {  
    "customer_id": "ac39ecc3-87ee-4d58-8ec0-24041464dddd",  
    "alert_id": "445b849e-1366-4580-a6cc-f488e27c059f",  
    "timestamp": "2024-10-07T15:08:44.865Z",  
    "threshold": 20000,  
    "alert_name": "Credit balance low",  
    "credit_type_id": "2714e483-4ff1-48e4-9e25-ac732e8f24f2",  
    "remaining_balance": 5000,  
    "triggered_by": "usage"  
  },  
  "type": "alerts.low_remaining_credit_balance_reached"  
}

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.
Create threshold notification interface showing spend threshold configuration
In the UI
  1. Navigate to the Notifications tab
  2. Click Create Notification
  3. Choose any of the above threshold notification types
  4. Configure threshold details and custom field level targeting where applicable
  5. 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
  6. Select customers that notification should be applied to
  7. Click Save
  8. 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
  9. Ensure your webhooks are set up to properly handle the payloads for these notifications
Via API
  1. Call POST /v1/alerts/create
  2. Pass in the alert type, name and threshold in the request body
  3. Optionally pass in additional filters relevant to the alert type
  4. A successful response will return a CustomerAlert object containing the notification configuration with its unique ID and current status
To get the real-time evaluation status for a specific threshold notification-customer pair, you can call the 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.
Threshold alerts have notifications sent within minutes of that condition being met.