|
7 | 7 |
|
8 | 8 | The folder `generic-notifier` provides a generic webhook which can be used to send messages to Sentry Slack channels and Sentry Datadog. Using this webhook is VERY simple. |
9 | 9 |
|
10 | | -Simply, go to `@/config/secrets.ts` and add an entry to the `EVENT_NOTIFIER_SECRETS` object. This entry should contain a mapping from the name of your service (for example, `example-service`) to an environment variable. [TODO: Fill in how to set the prod env var here]. Make a PR with this change and get it approved & merged. |
| 10 | +Simply, go to `@/config/secrets.ts` and add an entry to the `EVENT_NOTIFIER_SECRETS` object. This entry should contain a mapping from the source of the message (for example, `example-service`) to an environment variable. As of now, you will also need to edit `bin/deploy.sh` to add the new secret to the deployment and also add the secret to Google Secret Manager. Make a PR with this change and get it approved & merged. |
11 | 11 |
|
12 | | -Once this has been deployed, all you have to do is send a POST request to `https://product-eng-webhooks-vmrqv3f7nq-uw.a.run.app/event-notifier/v1` with a JSON payload in the format of the type `GenericEvent` defined in `@/types/index.ts`. Example: |
| 12 | +Once this has been deployed, all you have to do is send a POST request to `https://product-eng-webhooks-vmrqv3f7nq-uw.a.run.app/event-notifier/v1` with a JSON payload in the format of the type `GenericEvent` defined in `@/types/index.ts`. Currently, only Datadog and Slack messages are supported. Example: |
13 | 13 |
|
14 | 14 | ```json |
15 | 15 | { |
16 | 16 | "source": "example-service", // This must match the mapping string you define in the EVENT_NOTIFIER_SECRETS obj |
17 | 17 | "timestamp": 0, |
18 | | - "service_name": "official_service_name", |
19 | | - "data": { |
20 | | - "title": "This is an Example Notification", |
21 | | - "message": "Random text here", |
22 | | - "tags": [ |
23 | | - "source:example-service", "sentry-region:all", "sentry-user:bob" |
24 | | - ], |
25 | | - "misc": {}, |
26 | | - "channels": { |
27 | | - "slack": ["C07EH2QGGQ5"], |
28 | | - "jira": ["TEST"] |
| 18 | + "data": [ |
| 19 | + { |
| 20 | + "type": "slack", // Basic Slack message |
| 21 | + "text": "Random text here", |
| 22 | + "channels": ["#aaaaaa"], |
| 23 | + // Optionally, include Slack Blocks |
| 24 | + "blocks": [] |
| 25 | + }, { |
| 26 | + "type": "service_notification", // Slack message using service registry information |
| 27 | + "service_name": "eng_pipes_gh_notifications", |
| 28 | + "text": "Random text here", |
| 29 | + // Optionally, include Slack Blocks |
| 30 | + "blocks": [] |
| 31 | + }, { |
| 32 | + "type": "datadog", // Datadog message |
| 33 | + "title": "This is an Example Notification", |
| 34 | + "text": "Random text here", |
| 35 | + "tags": ["source:example-service", "sentry-region:all", "sentry-user:bob"], |
| 36 | + "alertType": "info" |
29 | 37 | } |
30 | | - } |
| 38 | + ] |
31 | 39 | } |
32 | 40 | ``` |
33 | 41 |
|
|
0 commit comments