Alert Monitors
Alert triggers
Many events can trigger an alert monitor:
- Execution Completed: This will trigger an alert upon a successful run of an instance. You could use this to notify customers when an instance runs to completion.
- Execution Duration Matched or Exceeded: Does your integration normally take 5 seconds? Do you want to be alerted if it takes longer than 10 seconds? Specify the maximum number of seconds you expect an instance to take, after which you'd like to be notified.
- Execution Failed: This will trigger an alert upon a failed run of an instance.
- Execution Failed, Retry Pending: This will trigger an alert if an instance fails to run, but a retry has been queued.
- Execution Overdue: Do you expect your integration to run every X minutes? This will trigger an alert if X has been reached.
- Execution Started: This will trigger an alert upon a start of an instance.
- Instance Disabled: This will trigger if an instance is disabled.
- Instance Enabled: This will trigger if an instance is enabled. You might want to use this to notify project managers when an instance is ready for a customer.
- Instance Removed: This will trigger if an instance is deleted.
- Log Level Matched or Exceeded: Are
error
, orwarn
log lines expected in standard execution of your integration? Presumably not. Specify a log level (error
, orwarn
), and if log lines are written that match or exceed that log level, an alert is triggered. - Connection Threw an Exception: This will trigger if a connection that is part of your deployed instance threw an exception, generally indicating that credentials in the connection are expired or invalid, or that the API that you are connecting to is down.
Some triggers, like Instance {Disabled, Enabled, Removed} are instance-specific, meaning they're not tied to a particular flow. The others are flow-specific, meaning you can set up alert monitors to trigger when events happen in specific flows.
For More Information: Log Levels
Alert monitors
An alert monitor is a combination of an alert group (users and webhooks) and an alert trigger that is configured for an instance. When you add an alert monitor to an instance, you specify when the monitor should be triggered, and which alert group(s) should be notified in the event of a trigger firing.
Note that if your instances are configured to use a shared endpoint and a preprocess flow, an alert monitor cannot be assigned to the preprocess flow since the preprocess flow runs independently of any deployed instance.
Creating an alert monitor
- Web App
- CLI
- API
After selecting an instance from a customer's Instances tab or the Instances link on the left-hand sidebar, click the instance's Monitors tab. Click the + Add alert monitor button on the top-right of the screen. Specify a name for the monitor and select a trigger. if you are in a customer's Instances tab, you'll need to also specify the instance.
After creating the alert monitor you will find yourself in the monitor's Details tab. Within this tab, you can add additional triggers to your alert monitor within the Triggers card. You can also choose the groups or users to notify and webhooks to trigger when an alert trigger fires.
To create an alert monitor you need to look up ID of the trigger you would like to create a monitor for, the instance's ID, and the ID of the group(s) to alert. Then, you can create a monitor using that trigger ID, instance ID, and group ID(s).
# Get Trigger ID
prism alerts:triggers:list --extended --filter 'name=^Execution Failed$'
Id Name
──────────────────────────────────────────────────────────────────── ────────────────
QWxlcnRUcmlnZ2VyOjQyYmM2MDY5LTE5YTktNDE1MS04ZjAwLTQ4ZWExN2E3MzZjMQ== Execution Failed
# Get Alert Group ID
prism alerts:groups:list --extended --filter 'name=^DevOps$'
Id Name
──────────────────────────────────────────────────────────────── ──────
QWxlcnRHcm91cDplMzcwMzY2OC0yZWM4LTQ0MWEtODdlYS02OGZjYTg1N2U5N2E= DevOps
INSTANCE_ID=$(prism instances:list --columns id --filter 'name=^Fabricate 3D Model for FTL Rockets$' --no-header)
prism alerts:monitors:create \
--groups "[\"QWxlcnRHcm91cDplMzcwMzY2OC0yZWM4LTQ0MWEtODdlYS02OGZjYTg1N2U5N2E=\"]" \
--name 'Alert Devops on Failure' \
--instance ${INSTANCE_ID} \
--triggers "[\"QWxlcnRUcmlnZ2VyOjQyYmM2MDY5LTE5YTktNDE1MS04ZjAwLTQ4ZWExN2E3MzZjMQ==\"]"
To create an alert monitor for an instance, you will need to query alertTriggers and select which types of triggers should result in an alert:
query listTriggers {
alertTriggers {
nodes {
id
name
}
}
}
You will also need the ID of the instance you want to attach the alert to, and the IDs of any users or groups who should be notified. Then, use the createAlertMonitor mutation to create the alert monitor:
mutation (
$name: String!
$instance: ID!
$triggers: [ID]!
$groups: [ID]
$users: [ID]
) {
createAlertMonitor(
input: {
name: $name
instance: $instance
triggers: $triggers
groups: $groups
users: $users
}
) {
alertMonitor {
id
}
}
}
{
"name": "Alert Alex and DevOps on Execution Failure",
"instance": "SW5zdGFuY2U6OTc1YzgyMTEtYTIxZi00OTg1LThhODYtMTUxMTczM2ZiYTJh",
"triggers": [
"QWxlcnRUcmlnZ2VyOjhiOTg3YmYxLTk4YmMtNDViNy1hZDFkLTEwNWY0YTExZjdlOA==",
"QWxlcnRUcmlnZ2VyOjdlOWEzMDA2LTQxODItNDQ0MC1iYzE2LTFiNjNjMzI2NzkwZA=="
],
"groups": ["QWxlcnRHcm91cDo5MDQyYmM1ZC1hYTU5LTQ3Y2EtOWE4NC00NWIxNDBmZjYzYmQ"],
"users": ["VXNlcjo4MzBjZTZmYS1iNDFlLTQ2MTQtODgzNi04NjA1MTcyY2IyOTc="]
}
Alerting on connection errors
You can set up an alert monitor to notify you if a connection in an instance becomes invalid (i.e. credentials expired or have been revoked, an API is down, etc). To alert on connection errors, create a new alert monitor and select Connection Threw an Exception as the trigger.
This is especially useful with OAuth 2.0 connections. You can be alerted if refreshing your access key fails for any reason, and you will be directed straight to relevant logs from the alert message that is sent to you or your team members
Editing existing alert monitors
To modify an existing alert monitor, click Instances on the left-hand sidebar and then select an instance. Under the instance's Monitors tab, select a monitor. This will bring you to the same screen you saw when you created the monitor, where you can modify who is notified under what conditions under the Details tab.
Deleting an alert monitor
- Web App
- CLI
- API
Click Customers from the left-hand sidebar and select a customer. Under the customer's Instances tab, select an instance and then click Monitors. Click into an alert monitor and open the Details tab. Scroll to the bottom of the page. Click Delete Monitor and confirm deletion by clicking Remove monitor
Find the ID of the alert monitor you would like to delete using
prism alerts:monitors:list --extended
and then delete the monitor with
prism alerts:monitors:delete ${ALERT_MONITOR_ID}
Delete an alert monitor with the deleteAlertMonitor mutation:
mutation {
deleteAlertMonitor(
input: {
id: "QWxlcnRNb25pdG9yOjQ4ZjVkZjkzLWU3MTAtNGFmNi1iZmRmLWU5ZWM4MDAzYTAyOA=="
}
) {
alertMonitor {
id
}
}
}