Switch it on
Create agent/instrumentation.ts. eve finds it by name and runs it at startup, before any
agent code, and there is no enable flag to set. Traces cover every turn, each model step with
its token counts, and each tool call. Keep the endpoint in the file rather than in
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: the workflow runtime bundles its own OTel SDK, which
reads that variable and exports every span again without your headers.
npm i @vercel/otel @opentelemetry/exporter-trace-otlp-http
import { registerOTel } from "@vercel/otel";
import { defineInstrumentation } from "eve/instrumentation";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
export default defineInstrumentation({
traceChannelRequests: true,
setup: ({ agentName }) =>
registerOTel({
serviceName: agentName,
traceExporter: new OTLPTraceExporter({
url: "https://ingestion.eu.bronto.io/v1/traces",
headers: { "x-bronto-api-key": process.env.BRONTO_API_KEY ?? "" },
}),
}),
});
npm i @vercel/otel @opentelemetry/exporter-trace-otlp-http
import { registerOTel } from "@vercel/otel";
import { defineInstrumentation } from "eve/instrumentation";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
export default defineInstrumentation({
traceChannelRequests: true,
setup: ({ agentName }) =>
registerOTel({
serviceName: agentName,
traceExporter: new OTLPTraceExporter({
url: "http://localhost:4318/v1/traces",
}),
}),
});
This assumes a Collector listening on localhost:4318; the
Local Collector setup shows how to start one.
This uses the endpoint and auth header you saved in the setup guide.
npm i @vercel/otel @opentelemetry/exporter-trace-otlp-http
import { registerOTel } from "@vercel/otel";
import { defineInstrumentation } from "eve/instrumentation";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
export default defineInstrumentation({
traceChannelRequests: true,
setup: ({ agentName }) =>
registerOTel({
serviceName: agentName,
traceExporter: new OTLPTraceExporter({
url: "YOUR_OTLP_ENDPOINT/v1/traces",
headers: { "YOUR_AUTH_HEADER": "YOUR_AUTH_VALUE" },
}),
}),
});