> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kubiks.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Vercel Integration

> AI-powered observability for Vercel apps with zero-config setup

## Overview

Kubiks is an AI-powered observability platform for Vercel apps. It automatically traces every part of your stack — API routes, database queries, background jobs, and LLM calls — using OpenTelemetry for full visibility with zero setup.

**Key Features:**

* **AI Agent** that monitors your stack, detects issues, and generates PRs with fixes
* **Automatic Tracing** across logs, traces, and source code
* **Real-time Root-Cause Analysis** and incident summaries
* **Unified Dashboard** for complete system visibility
* **Slack Integration** to chat with the agent and trigger actions

Built for speed and clarity, Kubiks helps you understand and fix issues instantly.

## Quick Setup

### 1. Enable Log Drains (Required)

Vercel Log Drains automatically forward your application's real-time logs (build, edge, serverless, runtime, and static) to Kubiks.

**Log Drains are required** for Kubiks to display all requests and correlate them with traces.

<Steps>
  <Step title="Add Drains">
    Navigate to the Integration page and click the **Add Drains** button.

    <img src="https://mintcdn.com/kubiks-fb8cce26/9guUMn1H8vLZHuoC/images/instructions/log-drains/1.png?fit=max&auto=format&n=9guUMn1H8vLZHuoC&q=85&s=b60492949eba7121ff8f25158d33ac49" alt="Install Kubiks integration" width="3200" height="2202" data-path="images/instructions/log-drains/1.png" />
  </Step>

  <Step title="Select Logs">
    Select **Logs** and click **Next**.

    <img src="https://mintcdn.com/kubiks-fb8cce26/9guUMn1H8vLZHuoC/images/instructions/log-drains/2.png?fit=max&auto=format&n=9guUMn1H8vLZHuoC&q=85&s=3aae594cbdf2b8f714e878db8f08cd9f" alt="Select logs option" width="2494" height="1444" data-path="images/instructions/log-drains/2.png" />
  </Step>

  <Step title="Create the Drain">
    Configure the drain settings and click **Create Drain** to complete the setup.

    <img src="https://mintcdn.com/kubiks-fb8cce26/9guUMn1H8vLZHuoC/images/instructions/log-drains/3.png?fit=max&auto=format&n=9guUMn1H8vLZHuoC&q=85&s=a3839155342b0a3a78415d507729ace0" alt="Configure and create drain" width="1622" height="1340" data-path="images/instructions/log-drains/3.png" />
  </Step>
</Steps>

<Warning>
  Log drains are required for Kubiks to visualize requests data.
</Warning>

### 2. Enable Trace Drains

Trace Drains send spans from your Vercel project to Kubiks, providing full request-level tracing and visibility.

<Steps>
  <Step title="Add Drains">
    Navigate to the Integration page and click the **Add Drains** button.

    <img src="https://mintcdn.com/kubiks-fb8cce26/9guUMn1H8vLZHuoC/images/instructions/trace-drains/1.png?fit=max&auto=format&n=9guUMn1H8vLZHuoC&q=85&s=6def36625decb6c9f9bd959a438549a3" alt="Add drains button" width="3200" height="2202" data-path="images/instructions/trace-drains/1.png" />
  </Step>

  <Step title="Select Traces">
    Select **Traces** and click **Next**.

    <img src="https://mintcdn.com/kubiks-fb8cce26/9guUMn1H8vLZHuoC/images/instructions/trace-drains/2.png?fit=max&auto=format&n=9guUMn1H8vLZHuoC&q=85&s=af89ec3c38c6c41efe52222143b0fd74" alt="Select traces option" width="2542" height="1262" data-path="images/instructions/trace-drains/2.png" />
  </Step>

  <Step title="Create the Drain">
    Configure the drain settings and click **Create Drain** to complete the setup.

    <img src="https://mintcdn.com/kubiks-fb8cce26/9guUMn1H8vLZHuoC/images/instructions/trace-drains/3.png?fit=max&auto=format&n=9guUMn1H8vLZHuoC&q=85&s=72cd86ea46ae500906e31ff65f277936" alt="Configure and create drain" width="1908" height="1466" data-path="images/instructions/trace-drains/3.png" />
  </Step>
</Steps>

### 3. Install OpenTelemetry SDK

Install the required OpenTelemetry packages:

<CodeGroup>
  ```bash npm theme={null}
  npm install @vercel/otel @opentelemetry/api @opentelemetry/api-logs
  ```

  ```bash pnpm theme={null}
  pnpm add @vercel/otel @opentelemetry/api @opentelemetry/api-logs
  ```

  ```bash yarn theme={null}
  yarn add @vercel/otel @opentelemetry/api @opentelemetry/api-logs
  ```
</CodeGroup>

### 4. Configure Instrumentation

Create an `instrumentation.ts` file in your **project root**:

```typescript instrumentation.ts theme={null}
import { registerOTel } from '@vercel/otel';

export function register() {
  registerOTel();
}
```

That's it! The `@vercel/otel` package automatically:

* Instruments HTTP requests, fetch calls, and Next.js internals
* Sends traces to Kubiks

## Instrument Your Dependencies

Enhance your observability by adding our OpenTelemetry SDKs for popular frameworks and services:

<CardGroup cols={2}>
  <Card title="Drizzle ORM" icon="database" href="/opentelemetry-integrations/otel-drizzle">
    Trace all database queries and transactions
  </Card>

  <Card title="Better Auth" icon="lock" href="/opentelemetry-integrations/otel-better-auth">
    Monitor authentication flows and sessions
  </Card>

  <Card title="Resend" icon="envelope" href="/opentelemetry-integrations/otel-resend">
    Track email delivery and operations
  </Card>

  <Card title="Upstash QStash" icon="message" href="/opentelemetry-integrations/otel-upstash-queues">
    Monitor message queue operations
  </Card>

  <Card title="Autumn Billing" icon="credit-card" href="/opentelemetry-integrations/otel-autumn">
    Trace billing and payment flows
  </Card>

  <Card title="View All Integrations" icon="grid" href="/opentelemetry-integrations/overview">
    Explore all available SDKs
  </Card>
</CardGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="No traces appearing in dashboard">
    Verify that **Trace Drains are enabled** in your Vercel project settings.

    Navigate to **Settings** → **Integrations** → **OpenTelemetry** and confirm the Kubiks endpoint is configured.
  </Accordion>

  <Accordion title="Logs not appearing">
    **Log drains are required** for Kubiks to work properly.

    1. Navigate to Vercel **Settings** → **Log Drains**
    2. Verify the Kubiks endpoint is listed and active
    3. If missing, reinstall the Kubiks integration
    4. Check the log drain status indicator (should be green/active)
  </Accordion>
</AccordionGroup>

## Resources

<CardGroup cols={2}>
  <Card title="Kubiks Dashboard" icon="chart-line" href="https://kubiks.ai">
    View your application traces and metrics
  </Card>

  <Card title="Vercel Marketplace" icon="triangle" href="https://vercel.com/integrations/kubiks">
    Install the Kubiks integration
  </Card>
</CardGroup>
