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

# Langtrace

> Integrate Langtrace observability with PraisonAI agents

# Langtrace Integration

[Langtrace](https://langtrace.ai/) provides LLM observability and tracing.

## Setup

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install langtrace-python-sdk
export LANGTRACE_API_KEY=xxx
```

## Usage

### Auto-Instrumentation (Recommended)

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai_tools.observability import obs
from praisonaiagents import Agent

obs.init(provider="langtrace")

# Everything is auto-traced!
agent = Agent(name="Assistant", instructions="You are helpful.", model="gpt-4o-mini")
response = agent.chat("Hello!")
```

### Explicit Tracing

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai_tools.observability import obs

obs.init(provider="langtrace", auto_instrument=False)

with obs.trace("workflow"):
    # Your agent code
    pass
```
