agent/instrumentation.ts hook. Eve
already emits OpenTelemetry spans for agent turns, model calls, sub-agent
invocations, and tools; Catalyst installs its OpenTelemetry provider from that
hook and enriches the exported spans with OpenInference attributes and $eve.*
workflow tags.
Use this guide for TypeScript Eve agents. If your app calls the Vercel AI SDK
directly outside Eve, use Vercel AI SDK traces
for those direct generateText or streamText calls.
Eve uses the presence of
agent/instrumentation.ts as the telemetry
enablement signal. For Eve apps, export defineCatalystEveInstrumentation()
from that file instead of calling setup() in your agent code.What Is Captured
- Eve turn spans such as
ai.eve.turnas OpenInference CHAIN spans - Eve
invoke_agentspans as AGENT spans - AI SDK v7 model spans inside Eve as LLM spans, including model, provider, input/output messages, finish reason, and token usage when the provider returns them
- Eve
execute_toolspans as TOOL spans, including tool name, call ID, arguments, result, and errors when available - Eve session, turn, parent, root, and trigger metadata
$eve.*aggregate fields such as model, input tokens, output tokens, cache tokens, and tool count- Custom runtime metadata added from
defineCatalystEveInstrumentation()
recordInputs and recordOutputs to true by default so the
dashboard can show model and tool IO. Set either option to false when a
deployment should avoid exporting full prompts, responses, tool arguments, or
tool results.
Install
Install Catalyst tracing in the same package where your Eve agent runs.TypeScript
TypeScript
Configure Export
Set the Catalyst traces endpoint and token before the Eve process starts.Add Eve Instrumentation
Createagent/instrumentation.ts at the root of your Eve agent. Eve loads this
file during agent startup.
TypeScript
functionId becomes Eve’s AI SDK telemetry function ID. Use a stable value for
the logical agent or workflow. serviceName becomes the OpenTelemetry
service.name resource attribute; when omitted, Catalyst uses Eve’s agent name.
Agent Provider Example
Youragent/agent.ts keeps using Eve normally. This example uses an
OpenAI-compatible AI SDK provider pointed at Catalyst Gateway.
TypeScript
includeUsage: true lets the provider return token counts for Catalyst columns.
modelContextWindowTokens is useful when Eve cannot infer context-window
metadata from a custom AI SDK provider model.
Tool Spans
Eve tools are captured automatically when the runtime emitsexecute_tool
spans. You do not need to wrap the tool manually.
TypeScript
tool.name,
tool_call.id, input.value, and output.value.
Existing Eve Hooks
If you already use Eve instrumentation events, pass them intodefineCatalystEveInstrumentation(). Catalyst composes your step.started
handler with its own handler and merges the returned runtime context.
TypeScript
Options
| Option | Purpose |
|---|---|
functionId | Stable Eve/AI SDK telemetry function ID. Defaults to Eve’s agent name when omitted. |
serviceName | OpenTelemetry service.name. Defaults to Eve’s agent name when omitted. |
recordInputs | Whether Eve/AI SDK records full inputs. Defaults to true. |
recordOutputs | Whether Eve/AI SDK records full outputs. Defaults to true. |
metadata | Primitive values merged into Eve’s AI SDK runtime context and exported as attributes. |
events | Eve instrumentation event hooks. Catalyst composes step.started with your hook. |
setup | Optional callback invoked from Eve’s startup hook after Catalyst tracing setup is requested. |
setup() options, such as batching and resourceAttributes,
can also be passed through. autoInstrument and modules are intentionally
managed by the Eve integration.
Verify In Catalyst
Run your Eve agent, trigger a turn, then open Catalyst and filter by yourservice.name, for example eve-weather-agent.
A successful Eve trace should include:
- An
ai.eve.turnCHAIN span with$eve.parent,$eve.root, and$eve.trigger - An
invoke_agentAGENT span withagent.nameandgen_ai.system=eve - One or more LLM spans for the nested AI SDK model calls
- TOOL spans for any executed Eve tools
- Token usage and model fields when the provider returns usage metadata
batching: "simple" can make spans export as
soon as they end. For long-lived Eve processes, the default batch exporter is
usually the better fit.
Troubleshooting
If Eve traces do not appear:- Confirm the file is named
agent/instrumentation.tsand is inside the Eve agent root. - Confirm
CATALYST_OTLP_ENDPOINTandCATALYST_OTLP_TOKENare available to the Eve process. - Use a stable
serviceNameand filter by that value in Catalyst. - Run Eve in a Node-compatible runtime. Catalyst configures the Node OpenTelemetry tracer provider for this integration.
- If model spans appear without token counts, set
includeUsage: trueon the AI SDK provider when the provider supports it. - If Eve cannot resolve model context metadata for a custom provider, set
modelContextWindowTokensindefineAgent().