---
title: Trace Drains Reference
description: Learn about Trace Drains - OpenTelemetry-compliant distributed tracing data formats and configuration.
url: "https://vercel.com/docs/drains/reference/traces"
last_updated: 2026-08-21
related:
  - /docs/drains/using-drains
  - /docs/drains/s3
  - /docs/tracing
  - /docs/drains
install_vercel_plugin: npx plugins add vercel/vercel-plugin
search_with_vercel_cli: npx vercel@latest docs search "<query>"
search_kb_with_vercel_cli: npx vercel@latest kb search "<query>"
---

# Trace Drains Reference

Trace Drains forward distributed tracing data from your deployments to external endpoints for storage and analysis. You can configure Trace Drains in three ways:

- **[Custom endpoint](/docs/drains/using-drains#custom-endpoint)**: Send traces to any OTLP/HTTP-compatible endpoint you configure
- **[Native integration](/docs/drains/using-drains#native-integrations)**: Use integrations from the Vercel Marketplace like [Braintrust](https://vercel.com/marketplace/braintrust)
- **[Amazon S3](/docs/drains/s3)**: Write traces to an S3 bucket in your AWS account

> **💡 Note:** Trace Drains that send to an endpoint use the [OTLP/HTTP](https://opentelemetry.io/docs/specs/otlp/#otlphttp) protocol. OTLP/gRPC endpoints (typically port 4317) are not supported. Make sure your endpoint accepts OTLP/HTTP requests (typically port 4318, path `/v1/traces`).

Vercel sends traces to endpoints over HTTPS following the [OTLP/HTTP](https://opentelemetry.io/docs/specs/otlp/#otlphttp) specification.

## Traces Schema

Trace Drains follow the [OpenTelemetry traces specification](https://opentelemetry.io/docs/concepts/signals/traces/). Vercel automatically adds these specific resource attributes to all traces:

| Name                   | Type   | Description                          | Example                 |
| ---------------------- | ------ | ------------------------------------ | ----------------------- |
| `vercel.owner_id`      | string | Identifier for the Vercel team       | `"team_a1b2c3d4e5f6g7"` |
| `vercel.project_id`    | string | Identifier for the Vercel project    | `"prj_a1b2c3d4e5f6g7"`  |
| `vercel.deployment_id` | string | Identifier for the Vercel deployment | `"dpl_a1b2c3d4e5f6g7"`  |

> **💡 Note:** Trace Drains also send these values under the deprecated camelCase keys `vercel.ownerId`, `vercel.projectId`, and `vercel.deploymentId`. The next major version of the Trace Drains schema removes them. Read the snake\_case keys instead.

## Format

Vercel supports the following formats for Trace Drains. You can configure the format when [configuring the Drain destination](/docs/drains/using-drains#configure-destination):

### JSON

Vercel sends traces as JSON objects following the OpenTelemetry specification:

```json
{ "resourceSpans": [{ "resource": { "attributes": [{ "key": "service.name", "value": { "stringValue": "vercel-function" } }] }, "scopeSpans": [{ "scope": { "name": "vercel" }, "spans": [{ "traceId": "7bba9f33312b3dbb8b2c2c62bb7abe2d", "spanId": "086e83747d0e381e", "name": "GET /api/users", "kind": "server", "startTimeUnixNano": "1694723400000000000", "endTimeUnixNano": "1694723400150000000" }] }] }] }
```

### Protobuf

Vercel sends traces in binary protobuf format over OTLP/HTTP. This format is more efficient for high-volume trace data transmission.

## Sampling Rate

Sampling rules control how much trace data each drain forwards so you can manage observability depth and spend. Add sampling rules to define how much data reaches your destination:

1. If no rules exist, click **Add Sampling Rule**.
2. Choose the environment you want to sample from.
3. Set the sampling percentage.
4. (Optional) Specify a request path prefix. Leave it blank to apply the rule to every path.

Example workflows:

- Launch-day monitoring: sample **100%** of production traffic when you launch a new feature, then decrease to **10%** once traffic stabilizes.
- Static coverage: always collect **5%** from `/docs` so you can spot regressions on a static documentation site.

Rules run from top to bottom. Requests that match a rule use that rule’s sampling rate, and any other requests are dropped. If you do not add rules, the drain forwards **100%** of data to the destination.

For how sampling decisions are made, including per-trace hashing and rule precedence, see [Sampling](/docs/tracing#sampling).

## Attribute truncation

Trace Drains follow the shared [attribute truncation behavior](/docs/tracing#attribute-truncation).

## Limitations

Trace Drains follow the shared [Tracing limitations](/docs/tracing#limitations).

## More resources

For more information on Trace Drains and how to use them, check out the following resources:

- [Drains overview](/docs/drains)
- [Configure Drains](/docs/drains/using-drains)
- [OpenTelemetry traces specification](https://opentelemetry.io/docs/concepts/signals/traces/)

## Search the docs from your terminal

Search the Vercel docs and read pages as Markdown with the Vercel CLI. No login required.

```bash
# Find docs pages by keyword
npx vercel@latest docs search "environment variables"
npx vercel@latest docs search "function timeout"

# Print a docs page as Markdown, by path or URL
npx vercel@latest docs inspect <page>
```

## Search guides from your terminal

Search the Knowledge Base and read guides as Markdown with the Vercel CLI. No login required.

```bash
# Find guides by keyword
npx vercel@latest kb search "rewrites and redirects"
npx vercel@latest kb search "AI SDK streaming"

# Show the latest guides
npx vercel@latest kb

# Print a guide as Markdown, by slug or URL
npx vercel@latest kb inspect <guide>
```

---

[View full sitemap](/docs/sitemap)


If you encounter incorrect information, can’t find what you need, need a capability Vercel doesn’t currently offer, or have any other feedback to report, please do it by following the instructions at https://vercel.com/feedback.md.
