Create your first alert
info
In this guide you'll learn how to create your first alert. To follow the instructions in this guide, you will need to have installed ThirdEye.
Alerts are the rules you build to detect anomalies. An alert configuration contains all the information necessary to:
- Fetch data from a datasource.
- Preprocess data
- Compute baselines
- Detect anomalies
- Send alerts to your subscription groups
In this tutorial, we will create an alert that detects when a metric does not lie between a minimum and a maximum value. We will also see how alerts are created in the ThirdEye UI. Let’s jump right in!
caution
The following assumes you have a working ThirdEye environment. See Install ThirdEye.
If you just want to understand detection in alerts, see understanding detection configuration.
Load a sample dataset
Start by loading some data into Apache Pinot.
- StarTree Cloud
- Go to your Startree Dataset Manager at [your_startree_url]/datasets.
- Click on Add New Dataset.
- We will use a sample dataset:
- Name the dataset
complexWebsite
- Click on Use Sample Data
- Select Website With Anomalies
- Click Next
- Name the dataset
- On the next screen, click Finish
The test dataset has now been loaded into Pinot.
Setup the datasource
Configure ThirdEye to get access to the Pinot database.
- StarTree Cloud
ThirdEye connects to the Pinot Database automatically.
Pinot datasets are onboarded automatically.
Ask StarTree support if you cannot see Pinot datasets in configuration → datasets.
Create the alert configuration
Go to your Thirdeye app.
Click on Alerts
On the alert page, set the dates between January 1, 2021 and December 31, 2021. We will simulate an alert rule based on this timeframe.
On the Alerts page, click on Create → Create Alert
Copy and paste this JSON in the configuration field:
This configuration includes the following:- StarTree Cloud
quickstart_complexWebsite_alert.json{
"name": "my-first-detection-configuration",
"description": "Detect anomalies in pageviews.",
"cron": "0 0/1 * 1/1 * ? *",
"template": {
"nodes": [
{
"name": "root",
"type": "AnomalyDetector",
"params": {
"type": "THRESHOLD",
"component.monitoringGranularity": "P1D",
"component.timestamp": "ts",
"component.metric": "met",
"component.max": "${max}",
"component.min": "${min}",
"anomaly.metric": "${metric}"
},
"inputs": [
{
"targetProperty": "current",
"sourcePlanNode": "missingDataManager",
"sourceProperty": "currentOutput"
}
],
"outputs": []
},
{
"name": "missingDataManager",
"type": "TimeIndexFiller",
"params": {
"component.timestamp": "ts"
},
"inputs": [
{
"sourcePlanNode": "currentDataFetcher",
"sourceProperty": "currentOutput"
}
],
"outputs": [
{
"outputName": "currentOutput"
}
]
},
{
"name": "currentDataFetcher",
"type": "DataFetcher",
"params": {
"component.dataSource": "${dataSource}",
"component.query": "SELECT __timeGroup(hoursSinceEpoch, '${timeColumnFormat}', '${monitoringGranularity}') as ts, ${metric} as met FROM ${dataset} WHERE __timeFilter(hoursSinceEpoch, '${timeColumnFormat}') GROUP BY ts ORDER BY ts LIMIT 10000"
},
"inputs": [],
"outputs": [
{
"outputKey": "pinot",
"outputName": "currentOutput"
}
]
}
],
"metadata": {
"datasource": {
"name": "${dataSource}"
},
"dataset": {
"name": "${dataset}"
},
"metric": {
"name": "views"
}
}
},
"templateProperties": {
"dataSource": "pinotQuickStart",
"dataset": "complexWebsite",
"metric": "sum(views)",
"monitoringGranularity": "P1D",
"timeColumn": "date",
"timeColumnFormat": "EPOCH_HOURS",
"max": "15000",
"min": "5000"
}
}Data Fetcher that runs a SQL query that returns the number of views grouped by time at an hour granularity.
Time Index Filler that fills in missing values.
Anomaly Detector that finds outliers in the dataset.
tip
For more on alert configuration, see understanding detection configuration.
Below the JSON configuration, in the preview panel, press the refresh button: you will see the result of the detection configuration. Notice that there are a few anomalies.
Try changing the dates on the timeframe selector in the top right corner and the min/max values in the JSON to see what happens.Click Next. Subscription Groups are used to send anomaly alerts to external systems like Slack and email. This can be added later, so let’s skip it for the moment. Click Next again.
A final page summarizes everything. Review and click on Finish.
That’s it! Your first alert is created, and you will be redirected to the alert page. When an alert is created, the detection is rerun on past data.
Anomalies will appear in the anomaly list. Let's now have a look at those.
View anomalies
Click on Anomalies in the left panel.
You should see anomalies! Click on one: you can now analyze the anomaly.
Next Steps
You've now successfully configured your first alert and been able to identify anomalies in the dataset.
- To learn how to use root cause analysis features in the anomaly pages, see root cause analysis concepts.
- To learn more about alert configuration, see Alert configuration and execution.
- To see alert examples, see create alerts how-tos.