Manual setup: OpenTelemetry
1. Install the exporter
2. Add the Agnost AI destination
Createagent/instrumentation/agnost.ts. eve loads every file in
agent/instrumentation/ on its own, so you don’t need to import this one anywhere.
agent/instrumentation/agnost.ts
runtimeContext adds userId to every model span, and Agnost AI uses it for
user-level analytics. principalId is the caller your channel’s auth accepted,
such as the subject of an OAuth token. To use your own ID instead, read it from
caller.attributes.
3. Record inputs and outputs in production
In preview and production, eve sends only metadata unless the channel marks the conversationpublic. Without message and tool content, Agnost AI can’t classify
intents, sentiment, or failures. Create agent/instrumentation/otel.ts to send it:
agent/instrumentation/otel.ts
recordInputs: false or recordOutputs: false for the
channel, audience, or environment the policy receives, or redact individual
attributes with an exportPolicy.attribute callback in agnost.ts.
4. Set your org ID and redeploy
AGNOST_ORG_ID in .env.local.
What appears in Agnost AI
- Conversations are grouped by eve’s session ID (
gen_ai.conversation.id), so every turn in one eve session lands in the same conversation. - Users come from the
userIdthatruntimeContextsets.
MCP servers built with eve
WithmcpChannel({ tools: true }), an MCP client can call the agent’s tools directly.
Each direct tools/call runs outside a conversation, so it appears in Agnost AI as
its own session with one tool event, including arguments, result, and latency. These
calls don’t run a model, so runtimeContext doesn’t apply and the event has no user.
Work started through agent_start runs a full agent turn and appears like any other
conversation.
Verify
- Start the agent with
AGNOST_ORG_IDset, for example witheve dev. - Send one message that makes the agent call a tool.
- Open Events in Agnost AI. You should see the turn, the model call, and the tool call with its arguments.
- Open Conversations to check that the turn is grouped under the eve session and attributed to the caller.
eve traces show for the most recent local
trace.
Troubleshooting
- No events: confirm
AGNOST_ORG_IDis set in the environment the deployment runs in, and redeploy after adding it. The URL must be the full trace endpoint,https://otel.agnost.ai/v1/traces. - Events without message or tool content: the default trace policy drops content
in preview and production. Add the
otel.tspolicy from step 3. - Many
workflow.*events in separate sessions: theexportPolicyfilter is missing fromagnost.ts. - Every user is anonymous: confirm
runtimeContextreturnsuserId, and that the channel’sauthidentifies callers. Direct MCP tool calls have no user, as described above.
References
- eve OpenTelemetry
- eve instrumentation and trace policy
- eve MCP channel
- Agnost AI OpenTelemetry endpoint
Next steps
- Conversations: review complete eve sessions.
- Tool calls: track tool reliability and latency.
- Patterns: organize production conversations by what users wanted.