Add Alerts to your Job
Pre-Requisites
Setup a Notification Channel Integration
on the Integrations page. Please follow this document to add an integration.
Currently two types of Notification Channels are supported:
- Slack (Webhook URL based): For this, please create a webhook for your slack and then add it as an integration in Slack Provider Account
- Email (SMTP credentials Integration): This can be found in Custom Provider Account. You can configure the SMTP Credentials of the mail server, from_email and to_emails and use it to send notifications.
How to Configure
From UI
-
In the Job form, please click on "Show Advanced Fields" and find the "Alerts" section
-
Select your notification channel and the triggers (on_start, on_completion, on_failure).
-
Click on Submit.
Once the Alerts are created you can see the alerts in your Slack/Email. Here is a sample Alert:
From CLI
To configure alerts when deploying from CLI or your CI/CD pipelines, Please add the following to your truefoundry.yaml
You will need to copy the FQN of your Notification Channel Integration and paste it as shown below.
type: job
name: churn-prediction-job
...
alerts:
- on_start: false
on_failure: true
on_completion: false
notification_channel: <Paste your notification channel integration fqn here>
From Python SDK
To configure alerts when deploying from Python SDK, Please add the following to your deploy.py
file:
from truefoundry.deploy import Job, JobAlert
job = Job(
...
alerts = [
JobAlert(
on_start=False,
on_completion=True,
on_failure=True,
notification_channel="<Paste your notification channel integration fqn here>"
)
]
)
Updated 19 days ago