feat(alerting): ClickUp alerting provider (#1462)
* feat(alerting): Add ClickUp alerting provider * test: added ClickUp tests, docs in README and switch http to github.com/TwiN/gatus/v5/client from http.Client * docs: Update ClickUp API token instructions in README * fix(alerting): Update ClickUp alert configuration and default values * docs: fixed formatting and removed line breaks from content in README * feat(alerting): Add group-specific overrides and validation checks, updated README * Update alerting/provider/clickup/clickup.go Co-authored-by: PythonGermany <97847597+PythonGermany@users.noreply.github.com> * fix(alerting): add priority validation * fix(alerting): set default priority to 3 * feat(alerting): add priority map for ClickUp provider * feat(alerting): make notify-all configurable for ClickUp provider * docs: add instructions for finding Assignee IDs for ClickUp * refactor(alerting): simplified ClickUp configurations example * refactor(alerting): clean up new lines in ClickUp provider --------- Co-authored-by: PythonGermany <97847597+PythonGermany@users.noreply.github.com>
This commit is contained in:
1 parent
6c8761ca35
commit
2d5f0a5927
9 files changed
+690
No files matched your search
@@ -58,6 +58,7 @@ Have any feedback or questions? [Create a discussion](https://github.com/TwiN/ga
|
||||
- [Tunneling](#tunneling)
|
||||
- [Alerting](#alerting)
|
||||
- [Configuring AWS SES alerts](#configuring-aws-ses-alerts)
|
||||
- [Configuring ClickUp alerts](#configuring-clickup-alerts)
|
||||
- [Configuring Datadog alerts](#configuring-datadog-alerts)
|
||||
- [Configuring Discord alerts](#configuring-discord-alerts)
|
||||
- [Configuring Email alerts](#configuring-email-alerts)
|
||||
@@ -827,6 +828,7 @@ endpoints:
|
||||
| Parameter | Description | Default |
|
||||
|:---------------------------|:----------------------------------------------------------------------------------------------------------------------------------------|:--------|
|
||||
| `alerting.awsses` | Configuration for alerts of type `awsses`. <br />See [Configuring AWS SES alerts](#configuring-aws-ses-alerts). | `{}` |
|
||||
| `alerting.clickup` | Configuration for alerts of type `clickup`. <br />See [Configuring ClickUp alerts](#configuring-clickup-alerts). | `{}` |
|
||||
| `alerting.custom` | Configuration for custom actions on failure or alerts. <br />See [Configuring Custom alerts](#configuring-custom-alerts). | `{}` |
|
||||
| `alerting.datadog` | Configuration for alerts of type `datadog`. <br />See [Configuring Datadog alerts](#configuring-datadog-alerts). | `{}` |
|
||||
| `alerting.discord` | Configuration for alerts of type `discord`. <br />See [Configuring Discord alerts](#configuring-discord-alerts). | `{}` |
|
||||
@@ -911,6 +913,72 @@ If the `access-key-id` and `secret-access-key` are not defined Gatus will fall b
|
||||
Make sure you have the ability to use `ses:SendEmail`.
|
||||
|
||||
|
||||
#### Configuring ClickUp alerts
|
||||
|
||||
| Parameter | Description | Default |
|
||||
| :--------------------------------- | :----------------------------------------------------------------------------------------- | :------------ |
|
||||
| `alerting.clickup` | Configuration for alerts of type `clickup` | `{}` |
|
||||
| `alerting.clickup.list-id` | ClickUp List ID where tasks will be created | Required `""` |
|
||||
| `alerting.clickup.token` | ClickUp API token | Required `""` |
|
||||
| `alerting.clickup.api-url` | Custom API URL | `https://api.clickup.com/api/v2` |
|
||||
| `alerting.clickup.assignees` | List of user IDs to assign tasks to | `[]` |
|
||||
| `alerting.clickup.status` | Initial status for created tasks | `""` |
|
||||
| `alerting.clickup.priority` | Priority level: `urgent`, `high`, `normal`, `low`, or `none` | `normal` |
|
||||
| `alerting.clickup.notify-all` | Whether to notify all assignees when task is created | `true` |
|
||||
| `alerting.clickup.name` | Custom task name template (supports placeholders) | `Health Check: [ENDPOINT_GROUP]:[ENDPOINT_NAME]` |
|
||||
| `alerting.clickup.content` | Custom task content template (supports placeholders) | `Triggered: [ENDPOINT_GROUP] - [ENDPOINT_NAME] - [ALERT_DESCRIPTION] - [RESULT_ERRORS]` |
|
||||
| `alerting.clickup.default-alert` | Default alert configuration. <br />See [Setting a default alert](#setting-a-default-alert) | N/A |
|
||||
| `alerting.clickup.overrides` | List of overrides that may be prioritized over the default configuration | `[]` |
|
||||
| `alerting.clickup.overrides[].group` | Endpoint group for which the configuration will be overridden by this configuration | `""` |
|
||||
| `alerting.clickup.overrides[].*` | See `alerting.clickup.*` parameters | `{}` |
|
||||
|
||||
The ClickUp alerting provider creates tasks in a ClickUp list when alerts are triggered. If `send-on-resolved` is set to `true` on the endpoint alert, the task will be automatically closed when the alert is resolved.
|
||||
|
||||
The following placeholders are supported in `name` and `content`:
|
||||
|
||||
- `[ENDPOINT_GROUP]` - Resolved from `endpoints[].group`
|
||||
- `[ENDPOINT_NAME]` - Resolved from `endpoints[].name`
|
||||
- `[ALERT_DESCRIPTION]` - Resolved from `endpoints[].alerts[].description`
|
||||
- `[RESULT_ERRORS]` - Resolved from the health evaluation errors
|
||||
|
||||
```yaml
|
||||
alerting:
|
||||
clickup:
|
||||
list-id: "123456789"
|
||||
token: "pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
assignees:
|
||||
- "12345"
|
||||
- "67890"
|
||||
status: "in progress"
|
||||
priority: high
|
||||
name: "Health Check Alert: [ENDPOINT_GROUP] - [ENDPOINT_NAME]"
|
||||
content: "Alert triggered for [ENDPOINT_GROUP] - [ENDPOINT_NAME] - [ALERT_DESCRIPTION] - [RESULT_ERRORS]"
|
||||
|
||||
endpoints:
|
||||
- name: website
|
||||
url: "https://twin.sh/health"
|
||||
interval: 5m
|
||||
conditions:
|
||||
- "[STATUS] == 200"
|
||||
alerts:
|
||||
- type: clickup
|
||||
send-on-resolved: true
|
||||
```
|
||||
|
||||
To get your ClickUp API token follow: [Generate or regenerate a Personal API Token](https://developer.clickup.com/docs/authentication#:~:text=the%20API%20docs.-,Generate%20or%20regenerate%20a%20Personal%20API%20Token,-Log%20in%20to)
|
||||
|
||||
To find your List ID:
|
||||
|
||||
1. Open the ClickUp list where you want tasks to be created
|
||||
2. The List ID is in the URL: `https://app.clickup.com/{workspace_id}/v/l/li/{list_id}`
|
||||
|
||||
To find Assignee IDs:
|
||||
|
||||
1. Go to `https://app.clickup.com/{workspace_id}/teams-pulse/teams/people`
|
||||
2. Hover over a team member
|
||||
3. Click the 3 dots (overflow menu)
|
||||
3. Click `Copy member ID`
|
||||
|
||||
#### Configuring Datadog alerts
|
||||
|
||||
> ⚠️ **WARNING**: This alerting provider has not been tested yet. If you've tested it and confirmed that it works, please remove this warning and create a pull request, or comment on [#1223](https://github.com/TwiN/gatus/discussions/1223) with whether the provider works as intended. Thank you for your cooperation.
|
||||
|
||||
Reference in new issue
Block a user