-
Notifications
You must be signed in to change notification settings - Fork 2
/
failure-alert-zenduty.yaml
67 lines (54 loc) · 2.31 KB
/
failure-alert-zenduty.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
id: failure-alert-zenduty
namespace: system
tasks:
- id: send_alert
type: io.kestra.plugin.notifications.zenduty.ZendutyExecution
url: https://www.zenduty.com/api/events/{{ secret('ZENDUTY_INTEGRATION_KEY') }}/
executionId: "{{ trigger.executionId }}"
triggers:
- id: on_failure
type: io.kestra.plugin.core.trigger.Flow
conditions:
- type: io.kestra.plugin.core.condition.ExecutionStatusCondition
in:
- FAILED
- WARNING
extend:
title: Set up alerts for failed workflow executions using Zenduty
description: >
This system flow will help you set up alerts for failed workflow executions.
Using this pattern, you can manage alerts on failure in one place.
This flow sends an alert to Zenduty whenever a flow execution fails.
## Setup
The only required input is an [integration
key](https://docs.zenduty.com/docs/api). The API integration will send an
API call that follows the format:
```bash
curl -X POST https://www.zenduty.com/api/events/[integration-key]/ -H
'Content-Type: application/json' -d '{"alert_type":"critical",
"message":"Some message", "summary":"some summary",
"entity_id":"some_entity_id"}'
```
The `message` and `summary` parameters are required. The `alert_type`
parameter is the severity of the issue, including `info`, `warning`,
`error`, or `critical`. The default value is `error`.
The `ZendutyExecution` task abstracts away raw API calls and only requires
the integration key, which you can store as a
[Secret](https://kestra.io/docs/concepts/secret). Visit the Zenduty [Events
API documentation](https://apidocs.zenduty.com/#tag/Events) for more
details.
## Customization
You can further customize that system flow by modifying the
`ZendutyExecution` task, or by adding more tasks to the flow.
## Restricting alerts using conditions
You can restrict the flow to only send alerts for specific namespaces by
adding an `ExecutionNamespaceCondition` to the trigger. You can read more
about that in the [Administrator
Guide](https://kestra.io/docs/administrator-guide/monitoring).
tags:
- System
- Notifications
ee: false
demo: false
meta_description: Set up alerts for failed workflow executions using Zenduty and
system flows in Kestra.