-
Notifications
You must be signed in to change notification settings - Fork 2
/
discord-alert.yaml
50 lines (46 loc) · 1.79 KB
/
discord-alert.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
id: discord-alert
namespace: company.team
tasks:
- id: send_discord_message
type: io.kestra.plugin.notifications.discord.DiscordExecution
url: "{{ secret('DISCORD_WEBHOOK') }}"
username: Rick Astley
embedList:
- title: Kestra Flow Notification
color:
- 255
- 255
- 255
executionId: "{{ trigger.executionId }}"
triggers:
- id: failed_prod_workflows
type: io.kestra.plugin.core.trigger.Flow
conditions:
- type: io.kestra.plugin.core.condition.ExecutionStatusCondition
in:
- FAILED
- WARNING
- type: io.kestra.plugin.core.condition.ExecutionNamespaceCondition
namespace: company.analytics
prefix: true
extend:
title: Send a Discord message when a production workflow fails
description: >-
This flow implements a namespace-level monitoring for all workflows in the
namespace `company.analytics`. Whenever an execution in that namespace
fails, this flow will automatically send a message to a Discord channel.
This means that you don't need any boilerplate code to implement alerting
logic. You only need to implement that once and thanks to the Flow trigger,
Kestra will make sure that all executions matching the conditions will
receive notifications.
To use this flow, you need to create a Discord webhook and store it as a
Secret. Follow this [guide on
Discord](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks)
to create a webhook.
tags:
- Notifications
ee: false
demo: false
meta_description: "This flow implements a namespace-level monitoring for all
workflows in the namespace `prod`. Whenever an execution in that namespace
fails, this flow will automatically send a message to a Discord channel. "