# Instrument Vercel eve agents with Sentry

> Instrument a Vercel eve agent with Sentry and inspect its conversations, model calls, tool executions, tokens, and latency.

**URL:** https://sentry.io/cookbook/send-eve-agent-traces-to-sentry/

---

Use Vercel eve's official Sentry instrumentation to send agent traces directly to Sentry over OTLP. No Sentry SDK is required.

**Time:** 10 minutes | **Difficulty:** Beginner

## What You'll Learn

- Added Vercel eve's official Sentry instrumentation

- Configured Sentry's OTLP traces endpoint and authentication

- Recorded prompts, responses, and tool details

- Generated a Vercel eve turn with model and tool spans

- Verified the conversation in Explore > Agents

**Topics:** AI Observability, Agent Tracing, Tracing

**SDKs:** Node.js

## Before you start

**SDKs & packages**

- A working [Vercel eve](https://eve.dev/) project

- The eve CLI available in the project

**Accounts & access**

- A [Sentry account](https://sentry.io/signup/) with a project

**Knowledge**

- Basic familiarity with Vercel eve's file-based agent structure

## Steps

### 1. Add Sentry instrumentation

Install Vercel eve's official Sentry instrumentation from its registry. The command creates `agent/instrumentation.ts` and adds the required OpenTelemetry packages. Sentry receives the traces directly, so this setup does not install a Sentry SDK.

```bash
eve add instrumentation/sentry
```

[Vercel eve's Sentry instrumentation](https://eve.dev/integrations/sentry-instrumentation)

### 2. Configure the OTLP endpoint

In Sentry, open your project and go to **Settings > Client Keys (DSN) > OpenTelemetry**. Copy the traces endpoint and the public key, then add them to your Vercel eve environment. The public key is the value after `sentry_key=` in the DSN.

```bash
SENTRY_OTLP_TRACES_ENDPOINT=https://o<org-id>.ingest.sentry.io/api/<project-id>/integration/otlp/v1/traces
SENTRY_PUBLIC_KEY=<public-key>
```

[Sentry OTLP concepts](https://docs.sentry.io/concepts/otlp/)

### 3. Enable conversation content

Set `recordInputs` and `recordOutputs` to `true` so Explore > Agents can show the prompt, response, and tool details. Review the data your agent handles before you enable this in production. Keep one telemetry provider to avoid duplicate spans.

```typescript
import { OTLPHttpProtoTraceExporter, registerOTel } from "@vercel/otel";
import { defineInstrumentation } from "eve/instrumentation";

export default defineInstrumentation({
  recordInputs: true,
  recordOutputs: true,
  setup: ({ agentName }) =>
    registerOTel({
      serviceName: agentName,
      traceExporter: new OTLPHttpProtoTraceExporter({
        url: process.env.SENTRY_OTLP_TRACES_ENDPOINT!,
        headers: {
          "x-sentry-auth": `sentry sentry_key=${process.env.SENTRY_PUBLIC_KEY}`,
        },
      }),
    }),
});
```

[Vercel eve instrumentation guide](https://eve.dev/docs/guides/instrumentation)

### 4. Run the agent and inspect its conversation

Start Eve and send a prompt that calls a tool. Need an idea? Try Sentry's [Slack agent example](https://github.com/getsentry/sentry-agent-tracing-examples/tree/main/slack-agent-eve). Open [Explore > Agents](https://sentry.io/orgredirect/organizations/:orgslug/explore/agents/) and select the conversation. Check Transcript for the captured input and output, then open Timeline to compare model calls, tool calls, cost, and latency. Use the Trace link to inspect Eve's `ai.eve.turn` span and the `invoke_agent`, `chat`, and `execute_tool` spans nested under it.

[Sentry AI agent monitoring](https://docs.sentry.io/product/agents/)

## Summary

**Your Vercel eve agent traces are in Sentry.**

Each turn now shows its model calls, tool executions, token use, and latency without adding the Sentry SDK to the agent.

## Pro Tips

- Use a tool-using prompt for the first test. It makes the model and tool hierarchy easy to verify.

- Set a stable Vercel eve agent name because the exporter uses it as the OpenTelemetry service name.

- Use Explore > Agents after the first export to compare model latency, token use, and tool calls across conversations.

- Keep input and output recording enabled for useful transcripts. Disable it on agents that handle data your policy does not allow Sentry to store.

## Common Pitfalls

- Using the full DSN as `SENTRY_PUBLIC_KEY`. This variable needs only the public key after `sentry_key=`.

- Using the generic OTLP base URL instead of the project-specific `/v1/traces` endpoint shown in Sentry.

- Adding the Sentry SDK for the same AI spans. Vercel eve's OTLP instrumentation already produces them, so a second producer can double-count tokens and cost.

- Expecting this baseline to send Sentry Logs or Issues. Vercel eve's official integration sends OTLP traces only.

## FAQ

**Do I need the Sentry Node.js SDK?**

No. Vercel eve exports standard OpenTelemetry traces directly to Sentry's OTLP endpoint.

**What data does the baseline integration send?**

It sends traces for the Vercel eve turn, model calls, and tool calls. This recipe also records prompts and model outputs. Sentry's OTLP intake does not turn span events into Logs or Issues.

**Can I control prompt and response capture?**

Yes. This recipe enables `recordInputs` and `recordOutputs`. Set either option to `false` if that content should not leave your application.

**Where should I look if traces do not appear?**

Check the project-specific traces endpoint, the public key, and `agent/instrumentation.ts`. Then run a long-lived development session and filter Explore > Agents by project and time range.

## Next Steps

- [Monitor agent spend](/cookbook/monitor-ai-agent-spend-with-dashboards-and-alerts/): Create a dashboard and monitors for cost, tokens, users, models, and conversations.

---

*Source: [sentry.io/cookbook/send-eve-agent-traces-to-sentry/](https://sentry.io/cookbook/send-eve-agent-traces-to-sentry/)*
