Alerts with Fiddler Client
In addition to using the Fiddler UI, users have the flexibility to set up alert rules using the Fiddler API client to enable the following workflows:
Add alert rule(s)
Delete alert rule(s)
Get the list of all alert rule(s)
Get the list of triggered alert(s)
📘 The user guide for setting up alert rules in the Fiddler UI is here.
Add an Alert Rule
The Fiddler client can be used to create a variety of alert rules types including Data Drift, Performance, Data Integrity, and Service Metrics.
Example 1: Data Integrity Alert Rule to Compare Against a Raw Percentage Value
Using the fdl.AlertRule.create() API method, let's set up a Data Integrity alert for the age column that triggers a warning email notification when published events exceed 5% null values in a 1 day bin and a critical email notification when exceeding 10% null values in a 1 day bin. Notice the comparison type compare_to=fdl.CompareTo.RAW_VALUE
which considers only the calculated metric value for the given bin_size
and threshold values.
Example 2: Performance Alert Rule to Compare Against a Previous Time Window
This example of a Performance alert rule uses comparison type compare_to=fdl.CompareTo.TIME_PERIOD
, also known as a relative alert, which considers the calculated metric value for the given bin_size
and threshold values with respect to the same bin in a previous time period. In this case the compare_bin_delta=1
parameter indicates the alert rule should compare the precision metric for the previous day with the precision metric for the current day. To compare the day's metric to the day's metric from 7 days ago, set compare_bin_delta=7
.
🚧 Please note, the possible values for compare_bin_delta vs bin_size are:
BinSize.Hour
[1, 24, 24 * 7, 24 * 30, 24 * 90]
BinSize.Day
[1, 7, 30, 90]
BinSize.Week
[1]
BinSize.Month
[1]
Retrieving Alert Rules
The fdl.AlertRule.list() API method is used to get a list of all alert rules with respect to the filtering parameters, returning a Python Iterator of matching alert rules. Note that all parameters are optional.
Delete an Alert Rule
Alert rules can be deleted by calling the delete() function on an instantiated fdl.AlertRule object. An alert rule can be retrieved by either the fdl.AlertRule.list() API method using filters or fdl.AlertRule.get() API method using the unique identifier which is found in the Alert Rule tab of the Fiddler Alerts page.
Get Triggered Alerts
Use the fdl.AlertRecord.list() API method to get the triggered alerts for a given alert rule. Note the alert rule unique identifier is required. The time range and sort order parameters are optional.
Notifications
After creating a new alert rule, assign the notification method for Fiddler to use when the alert rule is triggered. Currently Fiddler supports email, PagerDuty, Slack webhooks, and custom webhooks for notification types. You can specify 1 or more notification types and each type supports 1 or more recipients. Note that PagerDuty, Slack webhooks, and custom webhooks must be defined in advance by your Fiddler administrator.
The following example creates a notification configuration using email addresses, PagerDuty services, and a Slack webhook:
Last updated