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 here.
Add an Alert Rule
The Fiddler client can be used to create a variety of alert rules viz. Data Drift, Performance, Data Integrity, and **Service Metrics **
Example 1: Data Integrity Alert Rule to compare against a raw value
Let's sets up a Data Integrity alert that triggers an email notification when published events have 5% null values in a 1 day bin for the age column. Notice compare_to = 'raw_value'.
The fdl.AlertRule.create() API is used to create alert rules.
Please note, the possible values for bin_size are 'one_hour', 'one_day', and 'one_week'. When alert_type is 'data_integrity', use one of 'missing_value', 'range_violation', or 'type_violation' for metric type.
Example 2: Performance Alert Rule to compare against a previous time window
And the following API call sets up a Performance alert rule which triggers an email notification when precision metric is 5% higher than that from 1 day bin one day ago. Notice compare_to = 'time_period' and compare_bin_delta = '1 day'.
Please note, the possible values for compare_bin_delta vs bin_size are:
Bin Size | Allowed Compare bin delta |
---|---|
BinSize.Hour | [1, 24, 24 * 7, 24 * 30, 24 * 90] |
BinSize.Day | [1, 7, 30, 90] |
BinSize.Week | [1] |
BinSize.Month | [1] |
\
Get Alert Rules
The fdl.AlertRule.get() API can be used to get a list of all alert rules with respect to the filtering parameters and it returns a paginated list of alert rules.
Here is an example output of get_alert_rules() API:
Delete an Alert Rule
To delete an alert rule we need the corresponding unique alert_rule_uuid which is part of the output we get from fdl.AlertRule.get(). Then we can delete a rule by calling the fdl.AlertRuledelete() API as shown below:
Get Triggered Alerts
Finally, to get a paginated list of triggered alerts for a given alert rule in a given time range we can call the fdl.AlertRecord.list() API as the following:
\
Notifications
After creating a new alert rule, users choose the type of the notification that will be leveraged by Fiddler when an alert is raised. Currently Fiddler client supports email, PagerDuty and Webhook services as notifications. To create a notification configuration we add the notification config to Alert Rule. For example, the following code snippet creates a notification configuration using a comma separated list of email addresses.
To create a notification configuration using both email addresses and pager duty.
↪ Questions? Join our community Slack to talk to a product expert
\
Last updated