Skip to main content

Alerts

This document describes the alert types that Metronome supports and the options you have for creating and managing your alerts.

Alerts can be applied to a single customer, customers on a plan, or all customers.

Alert types

Low credit balance reached

This alert type allows you to set a threshold for a specific credit type and will evaluate a customer as in_alarm if the customer's balance for the credit type reaches or goes belows your set threshold. This alert type is measured throughout the day.

Spend threshold reached

This alert type allows you to set a threshold for a specific credit type and will evaluate a customer as in_alarm if the customer's spend for their current billing period reaches or goes above your set threshold. This alert type is measured throughout the day.

Low remaining days in plan

This alert type allows you to set a threshold for number of days and will evaluate a customer as in_alarm if the remaining days left of the customer's plan reaches or goes below your set threshold. This alert type is measured once a day.

Low remaining credit percentage

This alert type allows you to set a percentage threshold for a specific credit type. It will evaluate a customer as in_alarm if the percentage of available credits on all active credit grants for that credit type reaches or goes below your set threshold. This alert type is measured once a day.

Usage threshold reached

This alert type allows you to set a threshold for a specific billable metric and will evaluate a customer as in_alarm if the customer's usage for their current billing period (or previous billing period if events are received during the grace period) reaches or goes above your set threshold. This alert type is measured once a day and only applies to customers on a plan.

Webhook notifications

When a customer's alert status goes from ok to in_alarm, we will send you a webhook notification. In order to receive these webhooks, you must first set up a webhook. Read Webhooks for setup instructions and more information about Metronome webhooks.

Example webhook notifications for each alert type

Low credit balance reached

{
"id": "34c2cd16-b598-42dc-9f6c-62fd0fe37da1",
"type": "alerts.low_credit_balance_reached",
"properties": {
"customer_id": "5f24bd14-2909-4202-8b0d-b1af914d7460",
"alert_id": "41e5fd1b-7ff1-4731-8e01-b495db46c9be"
}
}

Spend threshold reached

{
"id": "ba0022aa-f4ba-4d33-b88b-b50cb4fd8f62",
"type": "alerts.spend_threshold_reached",
"properties": {
"customer_id": "6f04d9b5-186c-4698-89de-30b57ec614b4",
"alert_id": "6b881dcc-5354-49c5-94e1-c821ad2228f7"
}
}

Low remaining days in plan

{
"id": "9bdabff0-a4bc-4297-9ed8-044f9754022c",
"type": "alerts.low_remaining_days_in_plan_reached",
"properties": {
"customer_id": "d0b6f499-92c1-462c-8220-1097ff544811",
"alert_id": "26bd1df7-f417-49b6-8d8e-689180687f25"
}
}

Low remaining credit percentage

{
"id": "10aef0c7-8137-4a42-90a5-11d59047ab94",
"type": "alerts.low_remaining_credit_percentage_reached",
"properties": {
"customer_id": "98826491-f7d6-4bc6-9681-d3ba9add12e8",
"alert_id": "80a1c8db-6aec-4baf-bc56-a45092518db9"
}
}

Usage threshold reached

{
"id": "3a59012c-f4f0-4341-9fa4-6f1f08a64f2f",
"type": "alerts.usage_threshold_reached",
"properties": {
"customer_id": "403f9cc5-6867-4b5f-95f3-c993e15b3f33",
"alert_id": "14b2d2e5-19d7-41d1-a984-668bcd8aa441"
}
}

Creating an alert

Alerts can be created through the Metronome Alerts web UI. The following steps show an example of creating an alert for when a customer's credit balance reaches $10 remaining. We'll walk through how to create a low credit balance alert and send a webhook notification for customers on a specific plan:

creating an alert in the Metronome web UI

Alerts can also be created through the Metronome API by using the /alerts/create endpoint.

Accessing alert information

You can view all of your alerts and their statuses in the Metronome Alerts web UI. To view a specific customer's alerts, select the customer in the web UI and then click on the Alerts tab.

Through the API, you can retrieve a customer's alert status and alert information for a specific alert by using the /customer-alerts/get endpoint and for all of a customer's alerts by using the /customer-alerts/list endpoint.

Archiving an alert

Alerts can be archived through the Metronome Alerts web UI and through the API by using the /alerts/archive endpoint.