All integrations

Braintrust

Instrumentation

Export AI SDK spans to Braintrust for tracing, evals, and monitoring.

Read the full instrumentation docs

Install

Add the Braintrust integration from eve's registry:

bash
eve add instrumentation/braintrust

Quick start

eve installs a hook that traces agent activity and an instrumentation file that initializes the Braintrust logger:

ts
// agent/hooks/braintrust.tsimport { braintrustEveHook } from "braintrust";import { defineState } from "eve/context";import { defineHook } from "eve/hooks";
export default defineHook(  braintrustEveHook({    defineState,    metadata: {      app: "my-eve-agent", // Replace with your app name    },  }) as Parameters<typeof defineHook>[0],);
ts
// agent/instrumentation.tsimport { braintrustEveInstrumentation, initLogger } from "braintrust";import { defineState } from "eve/context";import { defineInstrumentation } from "eve/instrumentation";
export default defineInstrumentation(  braintrustEveInstrumentation({    defineState,    setup: ({ agentName }) => {      initLogger({        projectName: agentName,        apiKey: process.env.BRAINTRUST_API_KEY,      });    },  }) as Parameters<typeof defineInstrumentation>[0],);

Configure

Create an API key in the Braintrust dashboard and expose it as BRAINTRUST_API_KEY. Replace the hook's app metadata with your app name. Spans land in the Braintrust project named after your agent. See the instrumentation guide for the trace hierarchy and the recordInputs/recordOutputs controls.