Using Drains
Drains are available on Enterprise and Pro plans
You can add drains to your project by following the configuration steps below. When you configure the destination, choose between sending data to a custom HTTP endpoint and using a native integration or an external integration to send your data to popular services.
Teams on Pro and Enterprise plans can configure drains to forward observability data. You can send logs, traces, speed insights, and analytics data to a custom HTTP endpoint or use integrations from the Vercel Marketplace to send logs and traces data to popular services.
From the Vercel dashboard, go to Team Settings > Drains and click Add Drain.
Select the type of observability data you want to drain:
- Logs: Runtime, build and static logs from your deployments
- Traces: Distributed tracing data using OpenTelemetry Protocol
- Speed Insights: Performance metrics and web vitals
- Web Analytics: Page views and custom events
At any time, you can also add an external integration to available connectable account log drain integrations by clicking the External Integrations link on the top right of the Add Drain side bar.
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.
Configure the sampling rate to control the volume of data sent to your drain. This can help manage costs when you have high traffic volumes.
If you selected logs as your data type, you can also configure:
Sources - Select which log sources to collect:
- 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 to a different domain
- Builds: Outputs log data from the Build Step
- Firewall: Outputs log data from requests denied by Vercel Firewall rules
Environments - Select which environments to drain from:
- Production: Logs from production deployments with assigned domain(s)
- Preview: Logs from deployments accessed through the generated deployment URL
Choose how you want to receive your drain data by selecting either the Custom Endpoint or Native Integrations tab.
Configure a custom HTTP endpoint to receive drain data for any data type.
Endpoint URL
This is the URL of the endpoint we will send your data to. The request will be sent over HTTPS using the POST method. Make sure your endpoint responds with a 200 OK status code.
Format
Choose the delivery format based on your data type:
- Logs: JSON or NDJSON (see Logs reference)
- Traces: JSON or Protobuf (see Traces reference)
- Speed Insights: JSON or NDJSON (see Speed Insights reference)
- Web Analytics: JSON or NDJSON (see Analytics reference)
Signature Verification Secret (Optional)
You can secure your endpoint by comparing the
x-vercel-signature
header with this secret. See Securing your Drains for implementation details.A secret will be automatically generated for you, and you can change it and provide your own secret at any time.
Custom Headers (Optional)
Add custom headers for authentication, identification, or routing purposes. Common use cases include:
- Authentication: Bearer tokens, API keys, or custom auth headers
- Routing: Headers to route requests to specific services or regions
- Identification: Custom headers to identify the source or type of data
- Content negotiation: Headers to specify preferred response formats
Format headers as
Header-Name: Header-Value
with one header per line.Native integrations are available for log and traces data. You have 2 options:
-
Installed Products
If you've already installed a marketplace integration product that supports drains, you can select it here. The integration will handle endpoint configuration automatically.
-
Available Products
Browse and install available product integrations for this drain type:
- Click Install on any available product. This opens the Marketplace integration creation page in a new window.
- Update the default product name if needed and select a subscription plan
- Click Create and click Done once the integration has been created
- Go back to the Project's settings Drains page and select your newly created integration
You can also add a Drain from your team's Integrations tab
- Select the installed integration from the list. (Trace data shows under "Observability" and log data shows under "Logging")
- Click Manage and select your installed product
- Under Drains, click Add Drain
- Configure which project you would like to send data from and click Create Drain
Once you have configured all settings, click Create Drain. If you configured a custom endpoint, it will be tested automatically when you create the drain. Vercel will immediately start forwarding data based on your configuration.
You can test your endpoint anytime by clicking the Test button to ensure it receives the data correctly.
Vercel automatically correlates logs with distributed traces when using OpenTelemetry. Any logs generated during traced requests are enriched with correlation identifiers:
traceId
- The trace identifierspanId
- The span identifier
This correlation happens automatically without code changes. For example, this log:
console.log('User logged in', { userId: 123 });
Will be automatically enriched with trace and span identifiers.
Limitations: Only applies to user code logs during traced requests, not build-time logs.
You can create Drains with native integrations for the following data types by using native integrations during the configuration step:
- Log drains: Logging services like Dash0
- Trace drains: Observability services like Braintrust for OpenTelemetry trace streaming
- From the Vercel dashboard, go to Team Settings > Drains and click Add Drain.
- Click the External Integrations link on the top right of the Add Drain side modal.
- From the External Integration Log Drains modal, select the installed or available external integration you would like to use and follow the steps to create the drain to that service.
Learn more about native integrations and external (connectable accounts) integrations.
Occasionally your drain endpoints can return an error. If more than 80% of drain deliveries fail or the number of failures exceed 50 for the past hour, we will send a notification email and indicate the error status on your Drains page.


- From your team's dashboard, select the Settings tab
- Select Drains from the sidebar
- In available Drains, click on the menu on the right and click Pause to pause a drain or Resume to resume it
- In available Drains, click on the menu on the right and click Delete to delete a drain
For more information on Drains and how to use them, check out the following resources:
Was this helpful?