← Back to Cookbook

Instrument Eve agents with Sentry

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

SDKs
Category Monitoring
Time
10 minutes
Complexity
Beginner
Steps
4 steps

Before you start

SDKs & packages
  • A working Eve project
  • The Eve CLI available in the project
Accounts & access
Knowledge
  • Basic familiarity with Eve's file-based agent structure

1
Add Sentry instrumentation

Install 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.

Eve's Sentry instrumentation
Bash
eve add instrumentation/sentry

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 Eve environment. The public key is the value after sentry_key= in the DSN.

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

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.

Eve instrumentation guide
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}`,
        },
      }),
    }),
});

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. Open 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, ai.streamText, and ai.toolCall spans.

Sentry AI agent monitoring
An Eve dinner-planning conversation in the Sentry Explore Agents Timeline with model calls, tool calls, cost, and latency

That's it.

Your 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.

  • Added Eve's official Sentry instrumentation
  • Configured Sentry's OTLP traces endpoint and authentication
  • Recorded prompts, responses, and tool details
  • Generated an Eve turn with model and tool spans
  • Verified the conversation in Explore > Agents

Pro tips

  • 💡 Use a tool-using prompt for the first test. It makes the model and tool hierarchy easy to verify.
  • 💡 Set a stable 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. 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. Eve's official integration sends OTLP traces only.

Frequently asked questions

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

It sends traces for the 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.

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

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.

Fix it, don't observe it.

Get started with the only application monitoring platform that empowers developers to fix application problems without compromising on velocity.