> ## 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.

# Migrate from v0.3.x to v0.4.x

> Guide for migrating from Go SDK v0.3.x to v0.4.x

In v0.4.0, tracing integrations under `trace/contrib/*` moved from being bundled in the root SDK module to separate Go modules. Your source code and import paths don't change.

Follow the steps below to update your dependencies for the new module structure.

<Warning>
  **Breaking change**: If your code imports any `trace/contrib/*` packages and you skip the steps below, your build will fail to compile.
</Warning>

<Steps>
  <Step title="Upgrade the core SDK">
    ```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
    go get github.com/braintrustdata/braintrust-sdk-go@v0.4.0
    go mod tidy
    ```
  </Step>

  <Step title="Install the integration modules you use">
    Previously, the root SDK module bundled all `trace/contrib/*` packages. Now each one is its own Go module, so you must explicitly `go get` the ones your app imports:

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
    go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/openai@v0.4.0
    go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/anthropic@v0.4.0
    go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/genai@v0.4.0
    go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/genkit@v0.4.0
    go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/adk@v0.4.0
    go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/cloudwego/eino@v0.4.0
    go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/langchaingo@v0.4.0
    go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/github.com/sashabaranov/go-openai@v0.4.0
    go mod tidy
    ```

    Or, to install all integrations at once, use the `trace/contrib/all` meta-module (this also includes LangChainGo, which is new in v0.4.0):

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
    go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/all@v0.4.0
    go mod tidy
    ```
  </Step>

  <Step title="Verify your build config">
    Your existing `trace/contrib/*` import paths work exactly as before — no source code changes are needed.

    If you use Orchestrion for auto-instrumentation, make sure your `orchestrion.tool.go` imports `trace/contrib/all` or each individual integration module:

    ```go #skip-compile theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
    //go:build tools

    package main

    import (
    	_ "github.com/DataDog/orchestrion"
    	_ "github.com/braintrustdata/braintrust-sdk-go/trace/contrib/all"
    )
    ```
  </Step>

  <Step title="Rebuild and verify">
    Run `go build ./...` (or `orchestrion go build` if you use Orchestrion) and confirm your traced integrations still appear in Braintrust.

    <Note>
      For more detail on what changed in v0.4.0, see the [GitHub release notes](https://github.com/braintrustdata/braintrust-sdk-go/releases/tag/v0.4.0).
    </Note>
  </Step>
</Steps>
