Create a monitoring rule programmatically
Kensu also lets you create rules with code.
For the third run of the pipeline, we add a new function, add_variability_constraint_data_source, to reporting_v2.py.
This function creates a rule that will create a ticket when Adj Close.mean value deviates by more than 30% from the previous value.
Here is the code:
1️⃣ Run the following commands, selecting either Docker or Local Python:
2️⃣ In Kensu, you will see a new ticket. Click on the Tickets item on the Kensu homepage.
3️⃣ The new ticket violates a variability rule.