Working with Drains
Drains are available on Enterprise and Pro plans
Drains let you forward observability data from your applications to external services for debugging, performance optimization, analysis, and alerting, so that you can:
- Store observability data persistently in your preferred external services
- Process large volumes of telemetry data using your own tools
- Set up alerts based on application behavior patterns
- Build custom metrics and dashboards from your data
You can add Drains in the following ways:
- Custom endpoints: Configure any data type to send to a custom HTTP endpoint
- Audit Log destinations: Configure Audit Log Drains to send data to Amazon S3, Splunk, Datadog, or Panther
- Native integrations: Configure logs and trace data types to send to popular services like Dash0 and Braintrust using native integrations
Learn how to manage your active drains.
Drains support the following data types:
- Logs: Runtime, build, and static logs from your deployments (supports custom endpoints and native integrations)
- Traces: Distributed tracing data in OpenTelemetry format (supports custom endpoints and native integrations)
- Speed Insights: Performance metrics and web vitals (custom endpoints only). Requires Speed Insights Plus
- Web Analytics: Page views and custom events (custom endpoints only)
- Connect: Runtime events in the form of token requests, authorizations, revocations, and trigger deliveries from Vercel Connect connectors (custom endpoints only)
- Audit Logs: Team activity events
Each drain data type has specific formats, fields, and schemas. Review the reference documentation for logs, traces, speed insights, analytics, connect events, and audit logs to understand the data structure you'll receive from each data type.
When you create or update drains through the REST API, use the schemas property in the request body to specify which data type the drain receives. Each drain handles one data type.
The schemas object maps a schema name to a version object:
{
schemas: {
[schemaName: string]: {
version: string;
};
}
}The following table lists the available schema names:
| Schema name | Version | Data type |
|---|---|---|
log | v1 | Runtime, build, and static logs |
trace | v1 | Distributed tracing data in OpenTelemetry format |
analytics | v2 | Web Analytics page views and custom events |
speed_insights | v1 | Performance metrics and web vitals |
audit_log | v1 | Team activity events |
connect | v1 | Vercel Connect token and trigger events |
For example, to create a log drain, set log as the schema name with version v1:
{
"schemas": {
"log": { "version": "v1" }
}
}You also use the schemas property when validating drain delivery configuration. Pass the same schemas and delivery values you plan to use when creating the drain to verify your endpoint before the drain is live.
For details on the data each schema delivers, see the reference docs for logs, traces, speed insights, analytics, Connect events, and audit logs.
You can secure your drains by checking for valid signatures and hiding IP addresses. Learn how to add security to your drains.
Drains are available to all users on the Pro and Enterprise plans. Audit Log Drains are available only on Enterprise plans. If you are on the Hobby or Pro Trial plan, you'll need to upgrade to Pro to access non-audit-log drains.
Drains usage is billed based on the pricing table below. Pricing is the same regardless of data type:
| Resource | Price | Included (Pro) |
|---|---|---|
| Drains | $0.50 per 1 GB | N/A |
Billed gigabytes are measured as the uncompressed JSON serialization of each drained record, regardless of the format or encoding used to deliver it. Delivery to a destination can use protobuf, compression, or both, so the bytes a destination reports receiving (for example, an ingestion or "bytes received" metric in the destination service) can be lower than the billed bytes. The two figures measure different things and are not directly comparable. This difference is expected.
See Optimizing Drains for information on how to manage costs associated with Drains.
For more information on Drains, check out the following resources:
Was this helpful?