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

# Traceloop

> Trace LLM calls and workflows from Traceloop OpenLLMetry in Braintrust to debug prompts and monitor production usage

[Traceloop OpenLLMetry](https://www.traceloop.com/docs) is an observability framework for LLM applications. Braintrust captures the LLM calls, workflows, and application traces that Traceloop instruments and logs them to your Braintrust project.

<View title="Python" icon="/images/sdk-icons/python.svg">
  <h2 id="setup-python">
    Setup
  </h2>

  This integration uses Braintrust's [Python SDK OpenTelemetry configuration](/docs/integrations/sdk-integrations/opentelemetry#python-sdk-configuration). Install Traceloop alongside the Braintrust SDK, then point it at Braintrust's OpenTelemetry endpoint.

  <Steps>
    <Step title="Install the packages">
      Install Traceloop with the Braintrust SDK's OpenTelemetry support and the OpenAI client:

      ```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      pip install "braintrust[otel]" traceloop-sdk openai
      ```
    </Step>

    <Step title="Configure environment variables">
      Point Traceloop at Braintrust by setting its base URL and headers:

      ```bash title=".env" theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
      TRACELOOP_BASE_URL=https://api.braintrust.dev/otel
      TRACELOOP_HEADERS="Authorization=Bearer%20<Your API Key>, x-bt-parent=project_id:<Your Project ID>"
      ```

      <Note>
        When setting the bearer token, encode the space between "Bearer" and your API key using `%20`.
      </Note>
    </Step>
  </Steps>

  <h2 id="opentelemetry-python">
    OpenTelemetry
  </h2>

  To send traces to Braintrust, initialize Traceloop. It exports spans to the project named in the `x-bt-parent` header:

  ```python title="traceloop_braintrust.py" theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  from openai import OpenAI
  from traceloop.sdk import Traceloop
  from traceloop.sdk.decorators import workflow

  Traceloop.init(disable_batch=True)
  client = OpenAI()

  @workflow(name="story")
  def run_story(client):
      response = client.responses.create(
          model="gpt-5-mini",
          input=[{"role": "user", "content": "Tell me a short story about LLM evals."}],
      )
      return response.output_text

  print(run_story(client))
  ```

  <h2 id="resources-python">
    Resources
  </h2>

  * [Traceloop OpenLLMetry documentation](https://www.traceloop.com/docs).
  * [Braintrust OpenTelemetry guide](/docs/integrations/sdk-integrations/opentelemetry).
</View>
