Skip to main content

Notification

Currently supported:

  • Email notification using self-serve UI
  • Notifications to Slack is supported using APIs
  • Notifications to PagerDuty will be available soon!

From ThirdEye UI

Steps to configure a subscription group to receive email notifications is as follows:

  • Click on Create

  • Create Subscription Group

  • Type the “Name of the Subscription Group”

  • Enter schedule in cron job style (cron -n|-p|-s|-m mailcommand). The cron schedule. Defines when and at what frequency the subscription notifications will be sent. The format used is the 6-7 fields Quartz cron format. See Quartz documentation. A cron expression builder is available here.

  • Enter Email id in “Subscribe Emails” section then click add

  • Select and add alerts (one by one) to be subscribed by clicking “->” next to alert name in the “All alerts” section. (this is an optional step)

  • Click Next and Finish

    Subscription GroupConfigure Subscription Groups to subscribe to alerts and receive notifications

Slack [API Support]

All notification channels are hosted within subscription groups. CRUD operations can be performed as usual on subscription group entities using the /api/subscription-groups endpoint.

Step 1. Create a Slack App

Create a slack app for your workspace and add an incoming webhook. The webhook is tied to a specific channel and would look something like this.

https://hooks.slack.com/services/T1234567/AAAAAAAA/ZZZZZZ

Note that 1 app can support multiple incoming webhooks.

Optional: Subscription groups values can be populated via environment variables

To prevent the incoming webhook to be visible in plain text to any user, you can create an env variable (in kubernetes, you can also leverage secrets to do this).

export SLACK_WEBHOOK_URL="https://hooks.slack.com/services/T1234567/AAAAAAAA/ZZZZZZ"

Step 2. Create a subscription group

Here is a sample payload for creating the subscription group. You can submit this to POST /api/subscription-groups

 [
{
"name": "slack-webhook",
"cron": "*/1 * * * * ?",
"specs": [
{
"type": "slack",
"params": {
"webhookUrl": "${SLACK_WEBHOOK_URL}"
}
}
]
}
]

Step 3: Use your subscription group with any Alert

The subscription group can be tied to any alert as usual.

Also note that 1 subscription group supports multiple specs. Therefore, it can route to the same or different notification channels in the same subscription group.

Webhook [API Support]

The webhook notification allows you to input a url which thirdeye can use to POST a payload.

Here is a sample json payload to build a webhook notification.

 [
{
"name": "webhook",
"cron": "*/1 * * * * ?",
"specs": [
{
"type": "webhook",
"params": {
"url": "http://localhost:8080/internal/webhook"
}
}
]
}
]

The POSTed payload contains all the anomaly reports relevant for the notification service. Here's an example payload. It contains

  • The subscription group itself
  • Array of anomaly reports
  • A Report Object around all the anomalies
{
"subscriptionGroup": {
"id": 188059,
"name": "webhook",
"alerts": [
{
"id": 136062
}
],
"cron": "*/1 * * * * ?",
"specs": [
{
"type": "webhook",
"params": {
"url": "http://localhost:8080/internal/webhook"
}
}
]
},
"anomalyReports": [
{
"anomaly": {
"id": 188180,
"startTime": 1583020800000,
"endTime": 1588291200000,
"avgCurrentVal": 2.3475211E7,
"avgBaselineVal": 6.1570800760419734E7,
"score": 0.0,
"weight": 0.0,
"impactToGlobal": 0.0,
"sourceType": "ANOMALY_REPLAY",
"created": 1653463092111,
"notified": true,
"alert": {
"id": 188172
},
"metric": {
"name": "passenger_count"
},
"metadata": {
"dataset": {
"name": "us_monthly_air_passengers_simplified"
},
"metric": {
"name": "passenger_count"
}
}
},
"url": "http://localhost:7004/anomalies/188180",
"data": {
"metric": "passenger_count",
"startDateTime": "Mar 01, 2020 00:00",
"lift": "-61.87 %",
"feedback": "Not Resolved",
"anomalyId": "188180",
"anomalyURL": "http://localhost:7004/anomalies/",
"currentVal": "23,475,211",
"baselineVal": "61,570,800.76",
"dimensions": [],
"swi": "0.00 %",
"function": "us_monthly_passengers_simplified-holtwinters",
"funcDescription": "Sample description payload for testing",
"duration": "1,464 hours",
"endTime": "May 01, 2020 00:00",
"timezone": "UTC",
"anomalyType": "Deviation",
"properties": ""
}
}
],
"report": {
"startTime": "Sep 01, 2001 00:00",
"endTime": "May 01, 2020 00:00",
"reportGenerationTimeMillis": 1653464950589,
"dashboardHost": "http://localhost:7004",
"relatedEvents": [
{
"id": 3,
"name": "Related Holiday",
"type": "HOLIDAY",
"startTime": 1546310140005,
"endTime": 1546396540005,
"targetDimensionMap": {}
}
]
}
}