Alert Groups
Alert groups
You will likely want to alert the same group of people if integration X fails and if integration Y fails. To do that, you can create an alert group that can be assigned to multiple alert monitors. That way, if you hire a new DevOps engineer, you can quickly add them to the DevOps alert group and they'll automatically be added to each alert monitor the DevOps group is attached to.
Note that you can add both organization team members and customer users to alert groups. If you wish to notify customers when alerts trigger, for the sake of reusability we recommend creating an alert group per customer, and alert group(s) for your team. You can then attach your team's alert group(s) to all alert monitors, and your customer's alert group to the monitors only for their instances.
Creating alert groups
- Web App
- CLI
- API
Click Settings on the left-hand sidebar, and select the Alert Groups tab. Click the + Add alert group button on the upper-right and give your alert group a name (e.g. "Progix DevOps Team"). From there, you can enumerate users to be notified and webhooks to be invoked upon an alert being triggered.
Use the alerts:group:create
subcommand to create a new alert group.
You can pass in JSON-formatted lists of user IDs and webhook IDs
USER_IDS="[
\"$(prism organization:users:list --columns id --no-header --filter 'Email=edward.davis@progix.io')\",
\"$(prism organization:users:list --columns id --no-header --filter 'Email=kristin.henry@progix.io')\",
\"$(prism organization:users:list --columns id --no-header --filter 'Email=samantha.johnson@progix.io')\"
]"
WEBHOOK_IDS="[\"$(prism alerts:webhooks:list --columns id --no-header --filter 'name=Devops Webhook')\"]"
# Create an alert group to email your DevOps Team
prism alerts:groups:create \
--name DevOps \
--users "${USER_IDS}" \
--webhooks "${WEBHOOK_IDS}"
You can take advantage of jq to process JSON on the command line to simply your user IDs query.
# Create an alert group to alert customer users at FTL Rockets
CUSTOMER_ID=$(prism customers:list --columns id --no-header --filter 'Name=^FTL Rockets$')
CUSTOMER_USER_IDS=$(
prism customers:users:list \
--customer $CUSTOMER_ID \
--output json \
--columns id | jq '[.[].id]')
prism alerts:groups:create \
--name 'Customer - FTL Rockets' \
--users "${CUSTOMER_USER_IDS}"
To create an alert group you will need to know the IDs of the users and webhooks who you would like to add to the group. You can look up user IDs grouped by customer name with this query:
query {
customers {
nodes {
name
users {
nodes {
id
name
}
}
}
}
}
Alert webhook IDs can be queried for using this query:
query {
alertWebhooks {
nodes {
id
name
}
}
}
Once you have user IDs and alert webhook IDs, create an alert group using the createAlertGroup mutation:
mutation createAlertGroup($name: String!, $users: [ID], $webhooks: [ID]) {
createAlertGroup(input: { name: $name, users: $users, webhooks: $webhooks }) {
alertGroup {
id
}
}
}
{
"name": "DevOps",
"users": [
"VXNlcjplZTI3N2I4My0zOTBmLTQ3ODAtOGU4ZS1iYmNjOGY1Y2RlMTk=",
"VXNlcjpiNmZmNDJhNS1mOTM3LTRlOWEtYWMyYi0yNjNjYTFiYjgzYjQ="
],
"webhooks": [
"QWxlcnRXZWJob29rOjA2NmJkN2Q1LThiYTgtNGJlMi1hM2MyLTE3NzFlMzY3NmI3Zg=="
]
}
Editing existing alert groups
To modify an existing alert group, you will return to the same screen you saw when you created your alert group by clicking Settings on the left-hand sidebar and then select the Alert Groups tab. Click into an existing alert group. Within this screen, you can modify the name of the group by clicking the group's name at the top of the page. You can also modify the list of users and webhooks associated with the group.
Deleting alert groups
- Web App
- CLI
- API
To delete an alert group click the Settings link on the left-hand sidebar. Then, click the Alert Groups tab and select an alert group. Scroll to the bottom of the alert group's page and click Delete alert group. Click Remove alert group to confirm deletion.
Find the ID of the alert group you want to delete using
prism alerts:groups:list --extended
and then reference that ID using
prism alerts:groups:delete ${ALERT_GROUP_ID}
Delete an alert group using the deleteAlertGroup mutation:
mutation {
deleteAlertGroup(
input: {
id: "QWxlcnRHcm91cDo3MmU0OTMyNi1lMWYyLTRlNGEtYTNmZi00ZGIxZmY1NWViNmU="
}
) {
alertGroup {
id
}
}
}