https://flyte.org logo
#ask-the-community
Title
# ask-the-community
a

Ariel Kaspit

08/09/2023, 9:09 AM
Has someone configured notifications on flyte without any emailer service? I’m trying to understand how I can set alerts on workflow failure which will be sent to Slack channel
b

Broder Peters

08/09/2023, 9:14 AM
We've worked around it by subscribing to the SNS topics and have them be process by a lambda that pushes the notification to slack.
k

Kevin Su

08/09/2023, 10:34 PM
we’ll support slack webhook in the next release. https://github.com/flyteorg/flyteadmin/pull/583
a

Ariel Kaspit

08/10/2023, 8:31 AM
What about support to GCP?
k

Kevin Su

08/10/2023, 5:48 PM
we use google pub/sub. already support it now. check out the pr. really appreciate any feedback
a

Ariel Kaspit

08/20/2023, 8:20 AM
Ok sounds good, is there any
webhooknotifications
configuration for GCP so we can try it out?
@Kevin Su
k

Kevin Su

08/21/2023, 10:05 PM
@Ariel Kaspit
Copy code
externalEvents:
  enable: true
  type: "gcp"
  gcp:
    projectId: "your-project"
  eventsPublisher:
    topicName: "gcp-topic"
    eventTypes:
      - all
webhooknotifications:
  type: "gcp"
  gcp:
    projectId: "your-project"
  webhooks:
    name: slack
    urlSecretName: slack
    payload: "{{ name }} succeeded"
    processor:
      queueName: webhook
      accountId: "590375264460"
Need to add it to flyteadmin config map, and you need to create a secret for webhook URL and token if needed
btw, one question for both of you. would you use different webhook in different Launch plan. For example, one workflow use slack webhook, and another use MS team webhook. In the current implementation, flyteadmin will call all the webhook endpoints if the workflow is completed. cc @Fabio Grätz
f

Fabio Grätz

08/22/2023, 7:41 AM
Yes, having different webhooks would be great 🙏 Not sure whether we will use different providers but rather: launch plan a should send a notification into slack channel of team a and launch plan b into channel of team b …
Copy code
lp = LaunchPlan.get_or_create(
    notifications=[
        Webhook(
            name=<webhook_name>,  # Should match the name in Flyte admin config map.
            phases=[
                WorkflowExecutionPhase.SUCCEEDED,
            ],
            payload=["{{ name succeeded }}"],
        ),
    ],
)
What you wrote in the PR suggests that in the admin config map the platform team maintains a mapping from webhook name to webhook urls and the users choose one of the webhook names in the launch plan. This sounds very good to me. In the future I’d also be very interested in being able to include a custom message in the notification (e.g. to tag responsible people on workflow failure but other people on workflow success) but this is not for this PR I guess:
Copy code
lp = LaunchPlan.get_or_create(
    notifications=[
        Webhook(
            name=<webhook_name>,  # Should match the name in Flyte admin config map.
            message="... some custom string ...",         # <-----
            phases=[
                WorkflowExecutionPhase.SUCCEEDED,
            ],
            payload=["{{ name succeeded }}"],
        ),
    ],
)
Edit: Or is payload exactly that? 🤔
3 Views