Add Alerts to your Job

Pre-Requisites

Setup a Notification Channel Integrationon the Integrations page. Please follow this document to add an integration.

Currently two types of Notification Channels are supported:

  1. Slack (Webhook URL based): For this, please create a webhook for your slack and then add it as an integration in Slack Provider Account
  2. 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

  1. In the Job form, please click on "Show Advanced Fields" and find the "Alerts" section

  2. Select your notification channel and the triggers (on_start, on_completion, on_failure).

  3. 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.pyfile:

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>"
    )
  ]
)