Skip to content

Commit 2ce8cba

Browse files
DDS: Sanity: Add steps for Share Webhook Configuration in Readme (DataDog#20943)
* Update readme to add Share Webhook Configuration steps * Update: changes as per review comments
1 parent 74ffc6a commit 2ce8cba

1 file changed

Lines changed: 30 additions & 12 deletions

File tree

sanity/README.md

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,22 @@ Integrate Sanity with Datadog to gain insights into content and project-related
2929

3030
**Note**: These steps enable collection of project activity logs.
3131

32-
### Webhook Configuration
33-
Configure the Datadog endpoint to forward Sanity activity logs to Datadog. See [Sanity webhook documentation][4] for more details.
32+
### Retrieve the Datadog Webhook URL
3433

3534
1. Select an existing API key or create a new one by clicking one of the buttons below: <!-- UI Component to be added by Datadog team -->
36-
2. Log in to your [Sanity account][2] as an Administrator. You are automatically redirected to the [manage page][3].
37-
3. Select your project.
38-
4. In the navigation panel, click **API**.
39-
5. Click **Create Webhook**.
40-
6. Add the name and webhook URL generated in step 1.
41-
7. Select Dataset as `* (all datasets)`.
42-
8. Under the **Trigger on** section, select the types of Document events you want to send to Datadog.
43-
9. Under the **Projection** section, paste the below JSON:
35+
36+
**Note**: To set up the webhook, please follow the instructions provided in the Manual Webhook Configuration. Alternatively, you can use the Share Webhook Configurations option to apply a pre-configured setup.
37+
38+
### Manual Webhook Configuration
39+
40+
1. Log in to your [Sanity account][2] as an Administrator. You are automatically redirected to the [manage page][3].
41+
2. Select your project.
42+
3. In the navigation panel, click **API**.
43+
4. Click **Create Webhook**.
44+
5. Add the name and use the Datadog webhook URL.
45+
6. Select Dataset as `* (all datasets)`.
46+
7. Under the **Trigger on** section, select the types of Document events you want to send to Datadog.
47+
8. Under the **Projection** section, paste the below JSON:
4448
```
4549
{
4650
"documentId": _id,
@@ -54,8 +58,21 @@ Configure the Datadog endpoint to forward Sanity activity logs to Datadog. See [
5458
}
5559
```
5660
**Note**: It is recommended to _**uncheck**_ the **Trigger webhook when drafts are modified** checkbox in the Drafts section.
57-
10. Ensure **POST** is selected under **HTTP method** in the **Advanced settings section**.
58-
11. Click **Save**.
61+
9. Ensure **POST** is selected under **HTTP method** in the **Advanced settings section**.
62+
10. Click **Save**.
63+
64+
### Share Webhook Configuration
65+
66+
**Note**: These are alternative steps for **Manual Webhook Configuration**. Follow only one set of instructions.
67+
1. Log in to your [Sanity account][2] as an Administrator.
68+
2. To configure the webhook automatically, please follow the [Sanity webhook configuration][6].
69+
3. Update the existing URL with the Datadog webhook URL.
70+
4. Click **Apply webhook**.
71+
5. In the configuration dialog, set the following parameters:
72+
- **Organization**: Select the organization from the dropdown list.
73+
- **Project**: Select the relevant project from the dropdown list.
74+
- **Dataset**: Select `* (all datasets)`.
75+
6. Click **Create webhook**.
5976
6077
**Note**: These steps enable collection of document changes along with task and comment activity logs.
6178
@@ -82,3 +99,4 @@ For further assistance, contact [Datadog Support][5].
8299
[3]: https://www.sanity.io/manage
83100
[4]: https://www.sanity.io/docs/webhooks#
84101
[5]: https://docs.datadoghq.com/help/
102+
[6]: https://www.sanity.io/manage/webhooks/share?name=sanity-datadog&description=&url=https%3A%2F%2Fhttp-intake.logs.datadoghq.com%2Fapi%2Fv2%2Flogs%3Fdd-api-key%3D%3CYourDatadogAPIKey%3E%26ddsource%3Dsanity%26service%3Dactivity-logs&on=create&on=update&on=delete&filter=&projection=%7B%0A%20%20%20%20%22documentId%22%3A%20_id%2C%20%0A%20%20%20%20%22documentType%22%3A%20_type%2C%20%0A%20%20%20%20%22projectId%22%3A%20sanity%3A%3AprojectId()%2C%0A%20%20%20%20%22datasetName%22%3A%20sanity%3A%3Adataset()%2C%0A%20%20%20%20%22action%22%3A%20%22document.%22%20%2B%20delta%3A%3Aoperation()%2C%0A%20%20%20%20%22beforeValues%22%3A%20before()%2C%0A%20%20%20%20%22afterValues%22%3A%20after()%2C%0A%20%20%20%20%22timestamp%22%3A%20now()%0A%7D&httpMethod=POST&apiVersion=v2025-02-19&includeDrafts=&includeAllVersions=&headers=%7B%7D

0 commit comments

Comments
 (0)