> ## Documentation Index
> Fetch the complete documentation index at: https://braintrust.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Tracing quickstart

> Capture and inspect your AI app's execution

## 1. Install Braintrust CLI and instrument your app

In your project directory, run the following script:

```sh theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
curl -fsSL https://braintrust.dev/wizard/setup.sh | sh
```

This command will help you set up a Braintrust account, install `bt` (Braintrust CLI) and and it will guide you through instrumenting your application, so you can trace your AI calls in production.

## 2. View traces

Once instrumented, your app logs [traces](/observe/view-logs) to Braintrust for every AI call.

To view your traces in the Braintrust UI, open your project and go to [**<Icon icon="activity" /> Logs**](https://www.braintrust.dev/app/~/logs). Click into any trace to see:

* Complete input prompt and model output
* Token counts, latency, and cost
* Model configuration (temperature, max tokens, etc.)
* Request and response metadata

**This is the value of observability** — you can see every request, identify issues, and understand how your application behaves in production.

## Instrument by hand

To learn how to instrument your code by hand, using auto-instrumentation or explicit wrap functions, see [Trace LLM calls](/instrument/trace-llm-calls).

## Troubleshoot

<AccordionGroup>
  <Accordion title="Not seeing traces in the UI?">
    * Verify `BRAINTRUST_API_KEY` is set and starts with `sk-` (`echo $BRAINTRUST_API_KEY`)
    * Check that the project name in your code matches the project you're looking at in the UI
    * Check your console for error messages — common issues are invalid API key, network connectivity, or firewall blocking `api.braintrust.dev`
  </Accordion>

  <Accordion title="TypeScript auto-instrumentation not working?">
    * Run with `node --import braintrust/hook.mjs` (not `--loader`, which is deprecated)
    * Verify `braintrust` is installed (`npm list braintrust`)
    * Call `initLogger()` with a project name before making any LLM calls
    * Verify `BRAINTRUST_API_KEY` is set in your environment
    * Using a bundler (Vite, Webpack, esbuild, Rollup)? Use the bundler plugin instead of `--import`. See [TypeScript SDK documentation](/sdks/typescript/quickstart)
    * Requires Node.js 18.19.0+ or 20.6.0+ for `--import` flag support (`node --version`)
  </Accordion>

  <Accordion title="Python auto-instrumentation not working?">
    * Call `braintrust.auto_instrument()` at the start of your application, before any AI library imports or client creation
    * Verify `BRAINTRUST_API_KEY` is set in your environment
  </Accordion>

  <Accordion title="Ruby auto-instrumentation not working?">
    * Ensure your Gemfile has `gem "braintrust", require: "braintrust/setup"` (note the `require:` option)
    * Your application must load Bundler with `require 'bundler/setup'` and `Bundler.require` (default in Rails, may need to be added in Sinatra/Rack)
    * Verify `BRAINTRUST_API_KEY` is set in your environment
  </Accordion>

  <Accordion title="Go auto-instrumentation not working?">
    * Ensure you have a `go.mod` file (`go mod init your-project-name` if not)
    * Verify Orchestrion is installed (`orchestrion version`). If not, reinstall with `go install github.com/DataDog/orchestrion@latest`
    * Ensure `orchestrion.tool.go` exists in your project root with the correct imports
    * Build with `orchestrion go build` — regular `go build` won't instrument your code
    * Verify `BRAINTRUST_API_KEY` is set in your environment
    * Requires Go 1.26 or later (`go version`)
  </Accordion>

  <Accordion title="Need help?">
    * Join our [Discord](https://discord.gg/6G8s47F44X)
    * Email us at [support@braintrust.dev](mailto:support@braintrust.dev)
    * Use the [Loop](/loop) agent in the Braintrust UI
  </Accordion>
</AccordionGroup>

## Next steps

* Explore the full [Braintrust workflow](/workflow)
* Go deeper with tracing:
  * [Explore integrations](/integrations) with AI providers, SDKs, and developer tools
  * [Trace application logic](/instrument/trace-application-logic) for application logic
  * [Capture user feedback](/instrument/user-feedback) like thumbs up/down
  * [Analyze logs](/observe/view-logs) for patterns and issues
