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

# Open WebUI

> Export Open WebUI OpenTelemetry traces to Arize AX over OTLP.

[Open WebUI](https://openwebui.com/) supports OpenTelemetry export for its backend services. Send Open WebUI spans to an OpenTelemetry Collector, add the Arize AX project resource attribute, then export to Arize AX over OTLP.

<Note>
  This page covers Open WebUI's built-in backend telemetry. It captures service spans such as FastAPI routes, database calls, Redis calls, and outbound HTTP requests. It is not a full LLM conversation tracing integration by itself.
</Note>

<Note>
  Open WebUI documents endpoint and basic-auth configuration, but Arize AX needs Space ID and API Key headers. Use an OpenTelemetry Collector between Open WebUI and Arize AX so the collector can add the required headers.
</Note>

## Prerequisites

* A self-hosted Open WebUI deployment
* An Arize AX account ([sign up](https://arize.com/sign-up/))
* Your Arize AX **Space ID** and **API Key**

## Launch Arize AX

1. Sign in to your [Arize AX account](https://app.arize.com/).
2. From **Space Settings**, copy your **Space ID** and **API Key**.

## Configure Open WebUI OpenTelemetry

Set these environment variables on the Open WebUI service. They point Open WebUI at a local OpenTelemetry Collector:

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
ENABLE_OTEL=true
ENABLE_OTEL_TRACES=true
OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
OTEL_EXPORTER_OTLP_INSECURE=true
OTEL_SERVICE_NAME=open-webui
```

## Configure the OpenTelemetry Collector

Create `otel-collector-config.yaml`:

```yaml theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318

processors:
  batch:
  resource/arize_project:
    attributes:
      - key: openinference.project.name
        value: open-webui
        action: upsert

exporters:
  otlphttp/arize:
    endpoint: https://otlp.arize.com/v1
    headers:
      space_id: ${env:ARIZE_SPACE_ID}
      api_key: ${env:ARIZE_API_KEY}

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [resource/arize_project, batch]
      exporters: [otlphttp/arize]
```

<Note>
  For EU spaces, change the collector exporter endpoint to `https://otlp.eu-west-1a.arize.com/v1`.
</Note>

Run the collector with your Arize credentials:

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
export ARIZE_SPACE_ID="<your-space-id>"
export ARIZE_API_KEY="<your-api-key>"

docker run --rm --name otel-collector \
  -p 4317:4317 \
  -p 4318:4318 \
  -e ARIZE_SPACE_ID \
  -e ARIZE_API_KEY \
  -v "$PWD/otel-collector-config.yaml:/etc/otelcol/config.yaml" \
  otel/opentelemetry-collector-contrib:latest \
  --config /etc/otelcol/config.yaml
```

## Verify in Arize

1. Use Open WebUI and trigger backend requests.
2. Open your Arize AX space and select project **`open-webui`**.
3. Look for Open WebUI spans within \~30 seconds.

### Check from the skill, CLI, or SDK

Confirm spans are actually reaching your Arize AX project. Use whichever fits your workflow — the skill and CLI work for any framework; the SDK check is shown for each language.

<Tabs>
  <Tab title="Arize skill (agent)">
    Install the [Arize Skills](https://github.com/Arize-ai/arize-skills) plugin and let your coding agent check for you:

    ```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
    npx skills add Arize-ai/arize-skills
    ```

    Then prompt your agent:

    > Use the `arize-trace` skill to export and analyze recent traces from my project. Confirm spans are arriving, and summarize any errors or latency issues.
  </Tab>

  <Tab title="AX CLI">
    Export recent spans for your project — any rows mean traces are landing:

    ```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
    ax spans export "$ARIZE_PROJECT_NAME" --space "$ARIZE_SPACE_ID" \
      --limit 5 --stdout | jq 'length'
    ```

    A non-zero count confirms spans reached Arize AX. Run `ax auth login` first if you have not authenticated. See the [`ax spans` reference](/docs/api-clients/cli/spans).
  </Tab>

  <Tab title="SDK">
    Query the project's spans and check that at least one came back.

    <CodeGroup>
      ```python Python theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
      import os
      from arize import ArizeClient

      client = ArizeClient(api_key=os.environ["ARIZE_API_KEY"])
      resp = client.spans.list(
          project=os.environ["ARIZE_PROJECT_NAME"],
          space=os.environ["ARIZE_SPACE_ID"],
          limit=5,
      )
      count = len(resp.spans)
      print(
          f"{count} span(s) found" if count else "No spans yet — recheck setup"
      )
      ```

      ```typescript TypeScript theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
      // Reads ARIZE_API_KEY from the environment.
      import { listSpans } from "@arizeai/ax-client";

      const { data: spans } = await listSpans({
        project: process.env.ARIZE_PROJECT_NAME!,
        space: process.env.ARIZE_SPACE_ID!,
        limit: 5,
      });
      const count = spans.length;
      console.log(
        count ? `${count} span(s) found` : "No spans yet — recheck setup",
      );
      ```

      ```go Go theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
      client, err := arize.NewClient(
          arize.Config{APIKey: os.Getenv("ARIZE_API_KEY")},
      )
      if err != nil {
          log.Fatal(err)
      }
      resp, err := client.Spans.List(ctx, spans.ListRequest{
          Project: os.Getenv("ARIZE_PROJECT_NAME"),
          Space:   os.Getenv("ARIZE_SPACE_ID"),
          Limit:   5,
      })
      if err != nil {
          log.Fatal(err)
      }
      fmt.Printf("%d span(s) found\n", len(resp.Spans))
      ```
    </CodeGroup>

    SDK span references: [Python](/docs/api-clients/python/version-8/client-resources/spans) · [TypeScript](/docs/api-clients/typescript/version-1/client-resources/spans) · [Go](/docs/api-clients/go/version-2/client-resources/spans).
  </Tab>
</Tabs>

## What Arize captures

Open WebUI's built-in OpenTelemetry instrumentation can include spans for:

* FastAPI routes
* database queries
* Redis calls
* outgoing HTTP requests
* errors and latency on backend operations

## Add richer LLM traces

Open WebUI's built-in telemetry is useful for backend operations, but it may not include the full prompt, response, token, tool, and model metadata you expect from LLM observability. For richer LLM traces, instrument the model-provider path that Open WebUI calls:

* If Open WebUI sends traffic through an OpenAI-compatible gateway or provider, instrument that gateway or provider path with the matching OpenInference integration.
* If you maintain a custom Open WebUI Pipeline or filter, emit OpenTelemetry spans that follow OpenInference semantic conventions before exporting them to Arize AX.
* If Open WebUI calls a local model server such as vLLM, combine this page with the vLLM OpenTelemetry and OpenAI-compatible tracing setup.

## Troubleshooting

* **No traces in Arize.** Confirm `ENABLE_OTEL=true`, `ENABLE_OTEL_TRACES=true`, Open WebUI can reach the collector, and the collector has `ARIZE_SPACE_ID` and `ARIZE_API_KEY`.
* **Spans appear but LLM details are limited.** Open WebUI's built-in telemetry is backend telemetry. Add OpenInference instrumentation to the provider, gateway, or custom Pipeline path for richer LLM spans.
* **Project name is default.** Confirm the collector resource processor is running before the Arize exporter.

## Resources

<CardGroup>
  <Card icon="book-open" href="https://docs.openwebui.com/reference/monitoring/otel/" title="Open WebUI OpenTelemetry" horizontal />

  <Card icon="terminal" href="/docs/ax/concepts/otel-openinference/exporter" title="Arize AX OTLP exporter" horizontal />

  <Card icon="book-open" href="/docs/ax/cookbooks/instrument/openinference-best-practice" title="OpenInference best practices" horizontal />
</CardGroup>
