Braintrust
Braintrust is an AI evaluation and observability platform for experiments, spans, scores, and datasets. Respan’s Braintrust instrumentation registers as Braintrust’s background logger, translates Braintrust records into Respan’s tracing model, and sends them through the standard Respan OTLP pipeline.
Set up Respan
Create an account at platform.respan.ai and grab an API key.
Run npx @respan/cli setup to set up with your coding agent.
Example projects
Setup
Set environment variables
RESPAN_API_KEY exports traces to Respan. BRAINTRUST_API_KEY is used by Braintrust when you initialize a Braintrust project.
View your trace
Open the Traces page to see your Braintrust workflow, child spans, scores, token usage, and metadata.
Workflow names
For traces that are easy to find in Respan, use a readable root span name and propagate the same workflow name:
The instrumentation maps that value to trace_group_identifier and span_workflow_name, so root and child spans are recognizable by workflow name.
Span mapping
LLM spans include prompt messages, completion messages, model, and token usage when those fields are present in the Braintrust record.
Configuration
Notes
BraintrustInstrumentorcaptures Braintrust records when they are logged and exports them when Braintrust flushes.- Use
logger.flush()beforerespan.flush()so buffered Braintrust spans reach the Respan pipeline. - The older
respan-exporter-braintrustpackage sends legacy payloads directly. Userespan-instrumentation-braintrustfor the current tracing pipeline.