---
title: "Vercel"
description: "Learn how to set up Vercel drains to forward logs and traces data to Sentry."
url: https://docs.sentry.io/product/drains/vercel/
---

# Vercel Drains

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.

* **Logs**: Runtime, build, and static logs from your deployments
* **Traces**: Distributed tracing data collected via OpenTelemetry (OTLP) from your applications

## [Prerequisites](https://docs.sentry.io/product/drains/vercel.md#prerequisites)

Before you begin, ensure you have:

* A Vercel pro or higher plan and project that you want to monitor
* A Sentry project you want to send data to

## [Automatic Drain Setup](https://docs.sentry.io/product/drains/vercel.md#automatic-drain-setup)

If you've installed the [Sentry Vercel Integration](https://vercel.com/marketplace/sentry), you can set up a drain via the integration.

If you haven't installed the integration, you can follow the instructions in the [Sentry Vercel Integration documentation](https://docs.sentry.io/organization/integrations/deployment/vercel.md#install) to install the integration.

Then you can add a Drain from your Vercel team's Integrations tab.

1. From the Vercel dashboard, view the integrations list by clicking the **Integrations** tab.
2. Select the **Sentry** integration from the integrations list to view the integration settings.
3. Click **Manage** and select your installed product
4. Under **Drains**, click **Add Drain** to create a new drain.
5. Configure which project you would like to send data from and click **Create Drain** to create the drain.

Automatic Log Drain Setup for Vercel is only available with the Native Integration, which requires you to create a new Sentry Account when you install the integration. An existing Sentry account cannot be linked with the native integration at this moment. For those using an existing Sentry account, you can follow the instructions in the [Manual Drain Setup](https://docs.sentry.io/product/drains/vercel.md#manual-drain-setup) section to set up a drain manually.

## [Manual Drain Setup](https://docs.sentry.io/product/drains/vercel.md#manual-drain-setup)

To set up a Drain in Vercel manually, you'll need to create a new Drain in the Vercel settings.

1. From the Vercel dashboard, go to **Team Settings > Drains** and click **Add Drain**.
2. Choose a data type.

### [Manual Log Drain Setup](https://docs.sentry.io/product/drains/vercel.md#manual-log-drain-setup)

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

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.

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.

3. Select which log sources to collect. See [Log Source Details](https://docs.sentry.io/product/drains/vercel.md#log-source-details) for more information.

4. Select which environments to drain from. You can choose to drain from all environments or select specific ones.

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.

```bash
___VERCEL_LOG_DRAIN_URL___
```

6. Click the Custom Headers toggle and add the Sentry Authentication Header. You'll also find the header value in your [Sentry Project Settings](https://sentry.io/settings/projects/) under **Client Keys (DSN)** > **Vercel**.

```bash
x-sentry-auth: sentry sentry_key=___PUBLIC_KEY___
```

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

### [Manual Trace Drain Setup](https://docs.sentry.io/product/drains/vercel.md#manual-trace-drain-setup)

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

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.
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.
3. Under the custom endpoint tab add the Sentry Vercel Trace 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)** > **OpenTelemetry (OTLP)** under the **OTLP Traces Endpoint** section.

```bash
___OTLP_TRACES_URL___
```

4. Click the Custom Headers toggle and add the Sentry Authentication Header. You'll also find the header value in your [Sentry Project Settings](https://sentry.io/settings/projects/) under **Client Keys (DSN)** > **OpenTelemetry (OTLP)** under the **OTLP Traces Endpoint Headers** section.

```bash
x-sentry-auth: sentry sentry_key=___PUBLIC_KEY___
```

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

Sending [metrics](https://docs.sentry.io/product/explore/metrics.md) via Vercel Metric Drains (Speed Insights, Web Analytics) are 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 <feedback-metrics@sentry.io>.

## [Troubleshooting](https://docs.sentry.io/product/drains/vercel.md#troubleshooting)

Logs with empty messages

Some logs from the `static` or `edge` source have an empty log message. This is intended behavior, the vercel log drain schema intentionally sets an empty log message for some of these logs.

Logs from \`static\` source show up in Sentry but not the Vercel dashboard

If you drain logs with source `static` (**Static Files**) from Vercel, they will show up in Sentry but not in the Vercel Dashboard. By default the Vercel dashboard does not show these logs.

Trace-connected build logs

Build logs forwarded from Vercel are not trace-connected by default. You can use a combination of the `vercel.project_name`, `vercel.deployment_id`, and `vercel.build_id` fields to grab logs from a specific build.

## [Log Source Details](https://docs.sentry.io/product/drains/vercel.md#log-source-details)

Vercel Log Drains support the following log sources:

* **Functions**: Outputs log data from Vercel Functions like API Routes
* **Edge Functions**: Outputs log data from Vercel Functions or Routing Middleware using Edge runtime
* **Static Files**: Collects logs for static assets like HTML and CSS files
* **Rewrites**: Collects log results for external [rewrites](https://vercel.com/docs/project-configuration#rewrites) to a different domain
* **Builds**: Outputs log data from the Build Step
* **Firewall**: Outputs log data from requests denied by [Vercel Firewall](https://vercel.com/docs/vercel-firewall) rules

## [Video - Setting Up Vercel Drains](https://docs.sentry.io/product/drains/vercel.md#video---setting-up-vercel-drains)
