Skip to content

Commit dcc0417

Browse files
authored
feat: Add docs about vercel drains via vercel marketplace integration (#15730)
Documents support for log/trace drains with https://vercel.com/marketplace/sentry. This support was added with getsentry/getsentry#18932.
1 parent f34c47a commit dcc0417

File tree

2 files changed

+60
-24
lines changed

2 files changed

+60
-24
lines changed

docs/organization/integrations/deployment/vercel/index.mdx

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ If you make changes to your organization slug, you'll need to update your config
1616

1717
</Alert>
1818

19-
Connect your Sentry and Vercel projects to automatically notify Sentry of every deployment and upload source maps for your Next.js application.
19+
Connect your Sentry and Vercel projects to automatically notify Sentry of every deployment and upload source maps for your Next.js application. You can also set up Vercel Drains to forward logs and traces data from Vercel to Sentry.
20+
2021
To learn more about using Sentry in your Next.js app, check out the [Next.js SDK](/platforms/javascript/guides/nextjs/).
2122

2223
### Install
@@ -69,6 +70,10 @@ Use Vercel to [link projects](#project-linking) for uploading source maps and no
6970
- Add a Sentry bundler plugin to your bundler configuration ([webpack plugin](https://www.npmjs.com/package/@sentry/webpack-plugin), [Vite Plugin](https://www.npmjs.com/package/@sentry/vite-plugin), [Esbuild Plugin](https://www.npmjs.com/package/@sentry/esbuild-plugin), [Rollup Plugin](https://www.npmjs.com/package/@sentry/rollup-plugin)). If you are using Sentry's Next.js, or SvelteKit SDKs this will already have been done for you.
7071
- In case you already have a Vercel project integrated with Sentry, ensure the Sentry project you link is the one you're already using to report errors.
7172

73+
### Drains
74+
75+
You can set up [Vercel Drains](https://vercel.com/docs/drains) via the Vercel integration to forward logs and traces data from Vercel to Sentry. See the [Vercel Drains documentation](/product/drains/integration/vercel/#automatic-drain-setup) for more information.
76+
7277
### Uninstallation
7378

7479
1. You can uninstall the integration from Vercel or Sentry. To do so in Sentry, navigate to **Settings > Integrations > Vercel > Configurations**, click "Uninstall", and confirm.
@@ -79,12 +84,14 @@ Use Vercel to [link projects](#project-linking) for uploading source maps and no
7984

8085
### Troubleshooting
8186

82-
#### Failed to fetch
87+
<Expandable title="Failed to fetch">
8388

8489
![Failed to fetch error message](./img/vercel_failed_to_fetch.png)
8590

8691
This issue typically occurs if you have an ad blocker blocking the conversation between Vercel and Sentry during setup. To remediate the issue, disable your ad blocker and go through the installation flow again.
8792

93+
</Expandable>
94+
8895
## Vercel Marketplace
8996

9097
The Vercel Marketplace integration allows existing Vercel users to onboard to Sentry with a one-click workflow. This setup is designed for **new Sentry users** and unifies billing within the Vercel platform.
@@ -102,7 +109,9 @@ Subscription settings can only be modified within Sentry. During setup, organiza
102109
### User Access
103110

104111
<Alert>
105-
Only the individual who sets up Sentry using the one-click workflow will have a Sentry user account created for them. To enable single sign-on access from Vercel for other users, they must be invited to the Sentry organization.
112+
Only the individual who sets up Sentry using the one-click workflow will have
113+
a Sentry user account created for them. To enable single sign-on access from
114+
Vercel for other users, they must be invited to the Sentry organization.
106115
</Alert>
107116

108117
Vercel users will have single sign-on access to Sentry using the "Open in Sentry" button within Vercel, and will be able to create new projects in either Vercel or Sentry.
@@ -113,10 +122,13 @@ Users will still be able to login to their Sentry organization directly, without
113122

114123
For every project configured, the following environment variables will be set within the Vercel deployment:
115124

116-
- **SENTRY_PROJECT**
117-
- **SENTRY_AUTH_TOKEN**
118-
- **NEXT_PUBLIC_SENTRY_DSN**
119-
- **SENTRY_ORG**
125+
- **SENTRY_PROJECT**: Your configured Sentry project
126+
- **SENTRY_AUTH_TOKEN**: The Sentry authentication token for the Vercel Internal Integration
127+
- **NEXT_PUBLIC_SENTRY_DSN**: The DSN for your Sentry project
128+
- **SENTRY_ORG**: Your Sentry organization
129+
- **SENTRY_VERCEL_LOG_DRAIN_URL**: The Vercel Log Drain URL for your Sentry project (used for Vercel Log Drains)
130+
- **SENTRY_OTLP_TRACES_URL**: The OTLP Traces Drain URL for your Sentry project (used for Vercel Trace Drains)
131+
- **SENTRY_PUBLIC_KEY**: The public key for your Sentry project (used for authentication with log/trace drains)
120132

121133
### Integration Deletion
122134

docs/product/drains/integration/vercel.mdx

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ sidebar_order: 40
44
description: Learn how to set up Vercel drains to forward logs and traces data to Sentry.
55
---
66

7-
Vercel Drains let you forward traces and logs from applications running on Vercel to Sentry.
7+
Vercel Drains let you forward traces and logs from applications running on Vercel to Sentry. For more information on Vercel Drains, see the [Vercel drain documentation](https://vercel.com/docs/drains). Currently only Logs and Traces are supported.
8+
9+
- **Logs**: Runtime, build, and static logs from your deployments
10+
- **Traces**: Distributed tracing data collected via OpenTelemetry (OTLP) from your applications
811

912
## Prerequisites
1013

@@ -13,30 +16,34 @@ Before you begin, ensure you have:
1316
- A Vercel project that you want to monitor
1417
- A Sentry project you want to send data to
1518

16-
## Set up a Drain
19+
## Automatic Drain Setup
1720

18-
To set up a Drain in Vercel you'll need to create a new Drain in the Vercel settings. For more information on Vercel Drains, please see the [Vercel drain documentation](https://vercel.com/docs/drains).
21+
If you've installed the [Sentry Vercel Integration](https://vercel.com/marketplace/sentry), you can set up a drain via the integration.
1922

20-
1. From the Vercel dashboard, go to **Team Settings > Drains** and click **Add Drain**.
21-
2. Choose a data type. Currently only Logs and Traces are supported.
23+
If you haven't installed the integration, you can follow the instructions in the [Sentry Vercel Integration documentation](/organization/integrations/deployment/vercel/#install) to install the integration.
24+
25+
Then you can add a Drain from your Vercel team's Integrations tab.
26+
27+
1. From the Vercel dashboard, view the integrations list by clicking the **Integrations** tab.
28+
2. Select the **Sentry** integration from the integrations list to view the integration settings.
29+
3. Click **Manage** and select your installed product
30+
4. Under **Drains**, click **Add Drain** to create a new drain.
31+
5. Configure which project you would like to send data from and click **Create Drain** to create the drain.
2232

23-
- [Logs](#log-drains): Runtime, build, and static logs from your deployments (supports custom endpoints and native integrations)
24-
- [Traces](#trace-drains): Distributed tracing data in OpenTelemetry format (supports custom endpoints and native integrations)
33+
## Manual Drain Setup
34+
35+
To set up a Drain in Vercel manually, you'll need to create a new Drain in the Vercel settings.
36+
37+
1. From the Vercel dashboard, go to **Team Settings > Drains** and click **Add Drain**.
38+
2. Choose a data type.
2539

26-
### Log Drains
40+
### Manual Log Drain Setup
2741

2842
After selecting the Logs data type, you'll need to configure the drain to send data to Sentry.
2943

3044
1. Provide a name for your drain and select which projects should send data to your endpoint. You can choose all projects or select specific ones.
3145
2. Configure the sampling rate to control the volume of data sent to your drain. We recommend sampling 100% of the data to ensure you get all the data you need.
32-
3. Select which log sources to collect
33-
34-
- **Functions**: Outputs log data from Vercel Functions like API Routes
35-
- **Edge Functions**: Outputs log data from Vercel Functions or Routing Middleware using Edge runtime
36-
- **Static Files**: Collects logs for static assets like HTML and CSS files
37-
- **Rewrites**: Collects log results for external [rewrites](https://vercel.com/docs/project-configuration#rewrites) to a different domain
38-
- **Builds**: Outputs log data from the Build Step
39-
- **Firewall**: Outputs log data from requests denied by [Vercel Firewall](https://vercel.com/docs/vercel-firewall) rules
46+
3. Select which log sources to collect. See [Log Source Details](#log-source-details) for more information.
4047

4148
4. Select which environments to drain from. You can choose to drain from all environments or select specific ones.
4249
5. Under the custom endpoint tab add the Sentry Vercel Log Drain Endpoint in the URL field. You can find the endpoint in your [Sentry Project Settings](https://sentry.io/settings/projects/) under **Client Keys (DSN)** > **Vercel**. You can select either JSON or NDJSON encoding.
@@ -53,7 +60,7 @@ x-sentry-auth: sentry sentry_key=___PUBLIC_KEY___
5360

5461
7. To test that the log drain is working, you can send a test log to your drain by clicking the Test button.
5562

56-
### Trace Drains
63+
### Manual Trace Drain Setup
5764

5865
After selecting the Traces data type, you'll need to configure the drain to send data to Sentry.
5966

@@ -73,6 +80,12 @@ x-sentry-auth: sentry sentry_key=___PUBLIC_KEY___
7380

7481
5. To test that the trace drain is working, you can send a test trace to your drain by clicking the Test button.
7582

83+
<Alert level="warning">
84+
85+
Sending [metrics](/product/explore/metrics/) via Vercel Metric Drains (Speed Insights, Web Analytics) are currently not currently supported. If you're interested this support for this please reach out on [GitHub](https://github.com/getsentry/sentry/issues/103488) or or email us at [[email protected]](mailto:[email protected]).
86+
87+
</Alert>
88+
7689
## Troubleshooting
7790

7891
<Expandable title="Logs with empty messages">
@@ -92,3 +105,14 @@ x-sentry-auth: sentry sentry_key=___PUBLIC_KEY___
92105
use a combination of the `vercel.project_name`, `vercel.deployment_id`, and
93106
`vercel.build_id` fields to grab logs from a specific build.
94107
</Expandable>
108+
109+
## Log Source Details
110+
111+
Vercel Log Drains support the following log sources:
112+
113+
- **Functions**: Outputs log data from Vercel Functions like API Routes
114+
- **Edge Functions**: Outputs log data from Vercel Functions or Routing Middleware using Edge runtime
115+
- **Static Files**: Collects logs for static assets like HTML and CSS files
116+
- **Rewrites**: Collects log results for external [rewrites](https://vercel.com/docs/project-configuration#rewrites) to a different domain
117+
- **Builds**: Outputs log data from the Build Step
118+
- **Firewall**: Outputs log data from requests denied by [Vercel Firewall](https://vercel.com/docs/vercel-firewall) rules

0 commit comments

Comments
 (0)