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.
Before you start
SDKs & packages
- A working Eve project
- The Eve CLI available in the project
Accounts & access
- A Sentry account with a project
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 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_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.
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.
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 aftersentry_key=. - ⚠️ Using the generic OTLP base URL instead of the project-specific
/v1/tracesendpoint 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
recordInputs and recordOutputs. Set either option to false if that content should not leave your application.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.