-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement SLASensor #177
base: main
Are you sure you want to change the base?
Implement SLASensor #177
Conversation
Signed-off-by: Michael Espiritu <[email protected]>
databricks_token=api_token_key, | ||
custom_description="message to provide additional context", | ||
slack_webhook_url="https://hooks.slack.com/your/webhook/url", | ||
email_params={ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make email_params in the class initialization as a pydantic object or a type object to validate the email_params.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @asingamaneni - updated sla_sensor.py
to have an EmailParams pydantic object and use that to validate the email params passed to the SLASensor in the initialization. Will throw a ValidationError
if missing required fields
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #177 +/- ##
==========================================
+ Coverage 90.33% 92.08% +1.75%
==========================================
Files 22 22
Lines 3384 4322 +938
==========================================
+ Hits 3057 3980 +923
- Misses 327 342 +15 ☔ View full report in Codecov by Sentry. |
Description
This implements an SLASensor to monitor the on-time performance of Databricks workflows. It is a special instance of the WorkflowTaskDependencySensor that accepts an expected SLA time in the form of a UTC datetime object or a quartz cron expression in the workflow tags. The user provides the target workflow name and the task to monitor in that workflow that would indicate the workflow has completed. If the workflow does not finish by the specified time, an alert will be sent to a user-provided email and/or slack channel.
Related Issue
This PR closes #166.
Motivation and Context
Current alerting functionality only allows for alerts to be sent if a workflow runs longer than a specified amount of time. This change adds the functionality to be able to be alerted if a workflow does not finish by a certain time, regardless of when the workflow was kicked off.
How Has This Been Tested?
These changes were tested with
make test
and by building a wheel file and testing within a workflow. This implementation does not affect other features of brickflow.Screenshots (if appropriate):
Types of changes
Checklist: