Skip to content

Commit

Permalink
feat: upgrade notification engine (argoproj#14175)
Browse files Browse the repository at this point in the history
* feat: update notification-engine dependency to latest version

* feat: update notification-engine dependency to latest version
  • Loading branch information
pasha-codefresh authored and tesla59 committed Dec 16, 2023
1 parent 8110d32 commit 69bb054
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/operator-manual/notifications/services/email.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ data:
## Template
Notification templates support specifying subject for email notifications:
[Notification templates](../templates.md) support specifying subject for email notifications:
```yaml
apiVersion: v1
Expand Down
8 changes: 7 additions & 1 deletion docs/operator-manual/notifications/services/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The GitHub notification service changes commit status using [GitHub Apps](https:
## Configuration

1. Create a GitHub Apps using https://github.com/settings/apps/new
2. Change repository permissions to enable write commit statuses
2. Change repository permissions to enable write commit statuses and/or deployments
![2](https://user-images.githubusercontent.com/18019529/108397381-3ca57980-725b-11eb-8d17-5b8992dc009e.png)
3. Generate a private key, and download it automatically
![3](https://user-images.githubusercontent.com/18019529/108397926-d4a36300-725b-11eb-83fe-74795c8c3e03.png)
Expand Down Expand Up @@ -69,6 +69,12 @@ template.app-deployed: |
state: success
label: "continuous-delivery/{{.app.metadata.name}}"
targetURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
deployment:
state: success
environment: production
environmentURL: "https://{{.app.metadata.name}}.example.com"
logURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
requiredContexts: []
```
**Notes**:
Expand Down
4 changes: 2 additions & 2 deletions docs/operator-manual/notifications/services/pagerduty.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ data:
## Template
Notification templates support specifying subject for pagerduty notifications:
[Notification templates](../templates.md) support specifying subject for pagerduty notifications:
```yaml
apiVersion: v1
Expand Down Expand Up @@ -63,4 +63,4 @@ kind: Rollout
metadata:
annotations:
notifications.argoproj.io/subscribe.on-rollout-aborted.pagerduty: "<serviceID for Pagerduty>"
```
```
78 changes: 78 additions & 0 deletions docs/operator-manual/notifications/services/pagerduty_v2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# PagerDuty V2

## Parameters

The PagerDuty notification service is used to trigger PagerDuty events and requires specifying the following settings:

* `serviceKeys` - a dictionary with the following structure:
* `service-name: $pagerduty-key-service-name` where `service-name` is the name you want to use for the service to make events for, and `$pagerduty-key-service-name` is a reference to the secret that contains the actual PagerDuty integration key (Events API v2 integration)

If you want multiple Argo apps to trigger events to their respective PagerDuty services, create an integration key in each service you want to setup alerts for.

To create a PagerDuty integration key, [follow these instructions](https://support.pagerduty.com/docs/services-and-integrations#create-a-generic-events-api-integration) to add an Events API v2 integration to the service of your choice.

## Configuration

The following snippet contains sample PagerDuty service configuration. It assumes the service you want to alert on is called `my-service`.

```yaml
apiVersion: v1
kind: Secret
metadata:
name: <secret-name>
stringData:
pagerduty-key-my-service: <pd-integration-key>
```
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
data:
service.pagerdutyv2: |
serviceKeys:
my-service: $pagerduty-key-my-service
```
## Template
[Notification templates](../templates.md) support specifying subject for PagerDuty notifications:
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
data:
template.rollout-aborted: |
message: Rollout {{.rollout.metadata.name}} is aborted.
pagerdutyv2:
summary: "Rollout {{.rollout.metadata.name}} is aborted."
severity: "critical"
source: "{{.rollout.metadata.name}}"
```
The parameters for the PagerDuty configuration in the template generally match with the payload for the Events API v2 endpoint. All parameters are strings.
* `summary` - (required) A brief text summary of the event, used to generate the summaries/titles of any associated alerts.
* `severity` - (required) The perceived severity of the status the event is describing with respect to the affected system. Allowed values: `critical`, `warning`, `error`, `info`
* `source` - (required) The unique location of the affected system, preferably a hostname or FQDN.
* `component` - Component of the source machine that is responsible for the event.
* `group` - Logical grouping of components of a service.
* `class` - The class/type of the event.
* `url` - The URL that should be used for the link "View in ArgoCD" in PagerDuty.

The `timestamp` and `custom_details` parameters are not currently supported.

## Annotation

Annotation sample for PagerDuty notifications:

```yaml
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
annotations:
notifications.argoproj.io/subscribe.on-rollout-aborted.pagerdutyv2: "<serviceID for Pagerduty>"
```
2 changes: 1 addition & 1 deletion docs/operator-manual/notifications/services/rocketchat.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ metadata:

## Templates

Notification templates can be customized with RocketChat [attachments](https://developer.rocket.chat/api/rest-api/methods/chat/postmessage#attachments-detail).
[Notification templates](../templates.md) can be customized with RocketChat [attachments](https://developer.rocket.chat/api/rest-api/methods/chat/postmessage#attachments-detail).

*Note: Attachments structure in Rocketchat is same with Slack attachments [feature](https://api.slack.com/messaging/composing/layouts).*

Expand Down
6 changes: 3 additions & 3 deletions docs/operator-manual/notifications/services/slack.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The Slack notification service configuration includes following settings:
token: $slack-token
```

1. Add annotation in application yaml file to enable notifications for specific argocd app
1. Add annotation in application yaml file to enable notifications for specific argocd app. The following example uses the [on-sync-succeeded trigger](../catalog.md#triggers):

```yaml
apiVersion: argoproj.io/v1alpha1
Expand All @@ -60,7 +60,7 @@ The Slack notification service configuration includes following settings:
notifications.argoproj.io/subscribe.on-sync-succeeded.slack: my_channel
```

1. Annotation with more than one trigger multiple of destinations and recipients
1. Annotation with more than one [trigger](../catalog.md#triggers), with multiple destinations and recipients

```yaml
apiVersion: argoproj.io/v1alpha1
Expand All @@ -82,7 +82,7 @@ The Slack notification service configuration includes following settings:

## Templates

Notification templates can be customized to leverage slack message blocks and attachments
[Notification templates](../templates.md) can be customized to leverage slack message blocks and attachments
[feature](https://api.slack.com/messaging/composing/layouts).

![](https://user-images.githubusercontent.com/426437/72776856-6dcef880-3bc8-11ea-8e3b-c72df16ee8e6.png)
Expand Down
4 changes: 2 additions & 2 deletions docs/operator-manual/notifications/services/teams.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ metadata:
![](https://user-images.githubusercontent.com/18019529/114271500-9d2b8880-9a4c-11eb-85c1-f6935f0431d5.png)
Notification templates can be customized to leverage teams message sections, facts, themeColor, summary and potentialAction [feature](https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using).
[Notification templates](../templates.md) can be customized to leverage teams message sections, facts, themeColor, summary and potentialAction [feature](https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using).
```yaml
template.app-sync-succeeded: |
Expand Down Expand Up @@ -123,4 +123,4 @@ You can set a summary of the message that will be shown on Notifcation & Activit
template.app-sync-succeeded: |
teams:
summary: "Sync Succeeded"
```
```
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/alicebob/miniredis/v2 v2.30.3
github.com/antonmedv/expr v1.12.5
github.com/argoproj/gitops-engine v0.7.1-0.20230526233214-ad9a694fe4bc
github.com/argoproj/notifications-engine v0.4.1-0.20230228182525-f754726f03da
github.com/argoproj/notifications-engine v0.4.1-0.20230620204159-3446d4ae8520
github.com/argoproj/pkg v0.13.7-0.20221221191914-44694015343d
github.com/aws/aws-sdk-go v1.44.287
github.com/bmatcuk/doublestar/v4 v4.6.0
Expand Down Expand Up @@ -212,7 +212,7 @@ require (
github.com/shopspring/decimal v1.2.0 // indirect
github.com/skeema/knownhosts v1.1.1 // indirect
github.com/slack-go/slack v0.12.1 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/vmihailenco/go-tinylfu v0.2.2 // indirect
Expand Down
9 changes: 5 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ github.com/antonmedv/expr v1.12.5/go.mod h1:FPC8iWArxls7axbVLsW+kpg1mz29A1b2M6jt
github.com/appscode/go v0.0.0-20191119085241-0887d8ec2ecc/go.mod h1:OawnOmAL4ZX3YaPdN+8HTNwBveT1jMsqP74moa9XUbE=
github.com/argoproj/gitops-engine v0.7.1-0.20230526233214-ad9a694fe4bc h1:i6OgOvFFsoWiGBFEhhDNcYoRtxxtrVwcD7wCEeqhct4=
github.com/argoproj/gitops-engine v0.7.1-0.20230526233214-ad9a694fe4bc/go.mod h1:WpA/B7tgwfz+sdNE3LqrTrb7ArEY1FOPI2pAGI0hfPc=
github.com/argoproj/notifications-engine v0.4.1-0.20230228182525-f754726f03da h1:Vf9xvHcXn4TP/nLIfWn+TaC521V9fpz/DwRP6uEeVR8=
github.com/argoproj/notifications-engine v0.4.1-0.20230228182525-f754726f03da/go.mod h1:05koR0gE/O0i5YDbidg1dpr76XitK4DJveh+dIAq6e8=
github.com/argoproj/notifications-engine v0.4.1-0.20230620204159-3446d4ae8520 h1:ZCpg1Zk78E8QxMI52w6ZIddxkBHv27YWmfWQdxxWUkw=
github.com/argoproj/notifications-engine v0.4.1-0.20230620204159-3446d4ae8520/go.mod h1:sbhf4EjAUGAqRdHIzifDIiWsjlsTfmytVJJCCiUdyVA=
github.com/argoproj/pkg v0.13.7-0.20221221191914-44694015343d h1:7fXEKF3OQ9i1PrgieA6FLrXOL3UAKyiotomn0RHevds=
github.com/argoproj/pkg v0.13.7-0.20221221191914-44694015343d/go.mod h1:RKjj5FJ6KxtktOY49GJSG49qO6Z4lH7RnrVCaS3tf18=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
Expand Down Expand Up @@ -306,6 +306,7 @@ github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoD
github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c=
github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
Expand Down Expand Up @@ -953,8 +954,8 @@ github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTd
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA=
github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ nav:
- operator-manual/notifications/services/opsgenie.md
- operator-manual/notifications/services/overview.md
- operator-manual/notifications/services/pagerduty.md
- operator-manual/notifications/services/pagerduty_v2.md
- operator-manual/notifications/services/pushover.md
- operator-manual/notifications/services/rocketchat.md
- operator-manual/notifications/services/slack.md
Expand Down

0 comments on commit 69bb054

Please sign in to comment.