Braintrust (tracing)
Braintrust (tracing)
Connect your Braintrust project to receive tracing spans for model calls in hosted Runtype executions. View these executions in your Braintrust workspace alongside your other language model tools.
What you get
After you connect Braintrust, each model call in a hosted execution emits a runtype-execution parent span and a child span with type llm in your Braintrust project. The parent span includes execution metadata for the user, organization, flow, and execution IDs. The child span includes the input, output, provider, model, finish reason, token usage, and latency. If a provider call fails, the same span hierarchy records the terminal error and any partial output.
You receive these spans only after you connect a Braintrust project. If your account has one active connection, the execution uses it. If your account has several active connections, the execution uses the connection marked as default. If a legacy migration preserves several active teammate connections without a default, choose the intended destination in Settings before executions emit spans. Your Braintrust connection doesn’t replace or affect the built-in Runtype logs or observability.
Trace content limits
Trace export does not change your execution results. If a sanitized trace exceeds 1,000,000 serialized UTF-8 bytes, Runtype replaces its input, output, and any error content with omission markers and omits custom child metadata. Model/provider attribution, timing, and usage remain. If the reduced trace still exceeds the limit, it is not exported.
Connect Braintrust
To connect a Braintrust project, follow these steps:
- Sign up through Braintrust and create an API key.
- In Runtype, go to Settings > Integrations.
- In Braintrust, enter your API key in Braintrust API Key.
- Optional: Enter a project name in Project Name (optional). Runtype sends spans to this Braintrust project. If you leave the field blank, Runtype uses the
Runtypeproject. - Click Save Key.
Your active organization shares the Braintrust connection. In an organization, only organization admins can connect, rotate, or remove it. Runtype attributes those changes to the member who made them in the audit trail. Executions use the organization’s explicit Braintrust connection instead of the member who installed it. Runtype encrypts your API key at rest.
What gets traced
With a Braintrust connection, you receive spans for hosted Runtype execution paths: flow
prompt steps reached through flow dispatch, product surfaces that execute a flow, hosted
agent flows, scheduled flow runs, batches, and evals. The API-hosted runtime engine
traces a hosted dispatch when your account has a Braintrust integration. Direct model
calls outside hosted Runtype execution paths aren’t included. Standalone
@runtypelabs/runtime deployments don’t inherit this hosted integration automatically.
Runtype flushes spans in the background, so a Braintrust outage doesn’t slow down or block
your execution.
Next steps
- What are Logs?: inspect executions inside Runtype
- What are Evals?: test and compare prompts and models
- Connecting AI model providers: manage provider keys