Skip to main content
Try in Colab Notebook → Using Rebase Alerts, you can be notified via email or Slack based on data validators, pipeline crashes or other custom triggers. An alert is sent as:
import rebase as rb

rb.alert(title="Red alert", text="This is an alert!")

Using rebase.alert()

title
string
required
A short description of the alert, for example “Data out of bounds”.
text
string
required
A longer, more detailed description of why the alert got triggered.
level
AlertLevel
A flag specifying how important the alert is. Must be one of AlertLevel.INFO, AlertLevel.WARNING, or AlertLevel.ERROR. AlertLevelis imported from rebase.
buffer_time
integer
default:300
Number of seconds to add as buffer time between two alerts with the same title. This allows to reduce alert spam.

Example

This is a simple example of an alert that is created when the production falls below 80% of the theoretical production. In order to avoid alert spam, we set the
import rebase as rb
from rebase import AlertLevel

if production < 0.8*theoretical_production:
    rb.alert(
        title="Low production",
        text=f"Production {prod} is below the acceptable threshold {0.8*theoretical_production}",
        level=AlertLevel.WARNING,
        buffer_time=300
    )
rebase.alert()