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

# OpenInference Tracing

> OpenTelemetry-based auto-instrumentation that converts Pipecat traces to OpenInference for viewing in Arize Phoenix or Arize AX

> [!NOTE]
>
> **Community-maintained integration.** This service is built and
> maintained by
> [Arize-ai](https://github.com/Arize-ai)
> . Pipecat does not test or officially support it. Please report issues and
> request changes on the
> [source repository](https://github.com/Arize-ai/openinference)
> . Learn more about
> [community integrations](https://docs.pipecat.ai/api-reference/server/services/community-integrations.md)
> .

## Overview

`PipecatInstrumentor` is an auto-instrumentation library that converts Pipecat
traces to [OpenInference](https://github.com/Arize-ai/openinference), an
OpenTelemetry-compatible tracing format. It automatically wraps your
`PipelineWorker` to observe frame flow and create spans for LLM, TTS, and STT
services, which you can then view in
[Arize Phoenix](https://github.com/Arize-ai/phoenix) or Arize AX.

> [card] [Source Repository](https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-pipecat)
>
> Source code, examples, and issues for the OpenInference Pipecat
> instrumentation

> [card] [PyPI Package](https://pypi.org/project/openinference-instrumentation-pipecat/)
>
> The `openinference-instrumentation-pipecat` package on PyPI

> [card] [OpenInference](https://arize-ai.github.io/openinference/)
>
> OpenInference specification and documentation

> [card] [Arize Phoenix](https://github.com/Arize-ai/phoenix)
>
> Open-source LLM observability platform for viewing traces

## Installation

This is a community-maintained package distributed separately from `pipecat-ai`:

```bash theme={null}
uv add openinference-instrumentation-pipecat
```

## Prerequisites

This instrumentation emits OpenTelemetry traces in the OpenInference format, so
you need a backend to send them to. The repository's quickstart uses
[Arize Phoenix](https://github.com/Arize-ai/phoenix) (open source) or Arize AX:

* **Phoenix**: Run Phoenix locally or use a hosted instance, then register a
  tracer provider with `phoenix.otel.register(...)`.
* **Arize AX**: Provide an `ARIZE_SPACE_ID` and `ARIZE_API_KEY` and register
  with `arize.otel.register(...)`.

Because traces are standard OpenTelemetry, any OTLP-compatible backend may be
used. See the [source repository](https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-pipecat)
for the authoritative setup details.

## Usage

Set up a tracer provider and enable the instrumentor at the top of your
application, before building your Pipecat pipeline:

```python theme={null}
from phoenix.otel import register
from openinference.instrumentation.pipecat import PipecatInstrumentor
from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.worker import PipelineWorker
from pipecat.workers.runner import WorkerRunner

# Set up the tracer provider
tracer_provider = register(
    project_name="default",  # Phoenix project name
)

# Add the auto-instrumentor at the top of the application
PipecatInstrumentor().instrument(tracer_provider=tracer_provider)

# Build your Pipecat pipeline as usual
pipeline = Pipeline(...)

worker = PipelineWorker(
    pipeline,
    conversation_id=conversation_id,  # used for session tracking in Arize or Phoenix
)

runner = WorkerRunner(handle_sigint=runner_args.handle_sigint)
await runner.add_workers(worker)
await runner.run()
```

Once instrumented, the library injects an observer into each `PipelineWorker`,
and exchanges in the running application are logged to your project in Phoenix or
Arize AX.

> [!NOTE]
>
> The instrumentor wraps `PipelineWorker`. The deprecated `PipelineTask` alias
> is a thin subclass of `PipelineWorker` and is covered transparently. See the
> [source
> repository](https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-pipecat)
> for the full example.

## Compatibility

The instrumentation tracks Pipecat versions as follows:

| `openinference-instrumentation-pipecat` | `pipecat-ai` | Python |
| - | - | - |
| `>=2.0` | `>=1.3` | `>=3.11` |
| `>=1.0, <2.0` | `>=1.0, <1.3` | `>=3.11` |
| `<=0.1.4` | `<1.0` (e.g. `0.0.99`) | `>=3.10` |

Pipecat 1.3 deprecated `PipelineTask` in favor of `PipelineWorker`; use `>=2.0`
with `pipecat-ai>=1.3`. Check the [source repository](https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-pipecat)
for the latest tested versions and changelog.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.