Skip to content

Commit

Permalink
Added Sanity integration assets
Browse files Browse the repository at this point in the history
  • Loading branch information
mauneelsorathia-crest committed Jan 2, 2025
1 parent 8478b9d commit 7fea51c
Show file tree
Hide file tree
Showing 17 changed files with 4,697 additions and 20 deletions.
79 changes: 61 additions & 18 deletions sanity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,80 @@

## Overview

This check monitors [Sanity][1].
[Sanity][1] is a headless content management system (CMS) designed for building flexible, real-time websites and applications. It enables developers and content teams to efficiently manage structured content across multiple platforms.

## Setup

### Configuration
Integrate Sanity with Datadog to gain insights into content and project related activity logs through the Sanity API and GROQ-powered Webhook. Pre-built dashboard visualizations provide immediate insights into Sanity activity logs.

!!! Add list of steps to set up this integration !!!
## Setup

### Validation
### Generate API Token in Sanity

1. Log in to your [Sanity account][2] as an Administrator, it will redirect you to the [manage page][3].
2. Select your project.
3. In the navigation panel, click on **API**.
4. In the left sidebar, select **Tokens**.
5. Click **Add API Token**.
6. Enter a name and set the permission to **Viewer**.
7. Click **Save** to copy a newly generated token.

### Webhook Configuration
Configure the Datadog endpoint to forward Sanity activity logs to Datadog. See [Sanity webhook documentation][4] for more details.

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 -->
2. Log in to your [Sanity account][2] as an Administrator, it will redirect you to the [manage page][3].
3. Select your project.
4. In the navigation panel, click on **API**.
5. Click **Create Webhook**.
6. Add name and webhook URL generated from step 1.
7. Select Dataset as `* (all datasets)`.
8. Under the **Trigger on** section, select the types of Document events you want to be pushed into Datadog.
9. Under **Projection** section, paste below json in the input:
```
{
"documentId": _id,
"documentType": _type,
"projectId": sanity::projectId(),
"datasetName": sanity::dataset(),
"action": "document." + delta::operation(),
"beforeValues": before(),
"afterValues": after(),
"timestamp": now()
}
```
**Note**: It is recommended that the **Trigger webhook when drafts are modified** checkbox under the **Drafts** section should not be checked.
10. Ensure **POST** is selected under **HTTP method** in the **Advanced settings section**.
11. Click **Save**.
### Connect your Sanity account to Datadog
1. Add your Sanity API Token
|Parameters|Description|
|--------------------|--------------------|
|API Token|API Token of your Sanity project.|
2. Click the **Save** button to save your settings.
!!! Add steps to validate integration is functioning as expected !!!
## Data Collected
### Metrics
### Logs
Sanity does not include any metrics.
The Sanity integration collects and forwards Sanity activity logs to Datadog.
### Service Checks
### Metrics
Sanity does not include any service checks.
The Sanity integration does not include any metrics.
### Events
Sanity does not include any events.

## Troubleshooting
The Sanity integration does not include any events.
Need help? Contact [Datadog support][3].
## Support
[1]: **LINK_TO_INTEGRATION_SITE**
[2]: https://app.datadoghq.com/account/settings/agent/latest
[3]: https://docs.datadoghq.com/help/
For further assistance, contact [Datadog Support][5].
[1]: https://www.sanity.io/
[2]: https://www.sanity.io/login
[3]: https://www.sanity.io/manage
[4]: https://www.sanity.io/docs/webhooks#
[5]: https://docs.datadoghq.com/help/
Loading

0 comments on commit 7fea51c

Please sign in to comment.