Kensu Documentation

⌘K
Getting started with the Kensu Community Edition
Marketing campaign
Financial data report
Getting credentials
Recipe: Observe Your First Pipeline
Agents: getting started
Python
PySpark
Scala Spark
Databricks Notebook
Agent Listing
Docs powered by archbee 
3min

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:

Python
|

1️⃣ Run the following commands, selecting either Docker or Local scripts:

Docker Pandas
Docker PySpark
Local Pandas
Local PySpark
|

2️⃣ In Kensu, you will see a new ticket. Click on the Tickets item on the Kensu homepage.

Document image

3️⃣ The new ticket violates a variability rule.

Document image
Updated 07 Nov 2022
Did this page help you?
Yes
No
UP NEXT
Getting credentials
Docs powered by archbee