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

# LLM tracing

> Every model call becomes a trace span automatically — no change to your model code.

Alongside the transcript, Eldros captures **traces**: what your agent actually did to produce each reply. Every LLM call becomes a `gen_ai.*` span (OpenTelemetry semantic conventions) carrying the model, token usage, latency, errors, and — by default — the prompt and response content. Traces are what turn a verdict into a diagnosis: the judge flags the conversation, the trace shows *why*.

## Enabling it: the extra is the switch

Auto-instrumentation follows your install — if the instrumentation package is present, `init()` turns it on. No flags needed:

```bash theme={null}
pip install "eldros-sdk[openai]"            # OpenAI SDK calls → gen_ai.* spans
pip install "eldros-sdk[anthropic]"         # Anthropic SDK calls
pip install "eldros-sdk[claude-agent-sdk]"  # Claude Agent SDK (via LangSmith)
```

```python theme={null}
eldros_sdk.init(traffic_type="prod")        # picks up installed instrumentation automatically
```

To override the default in either direction, use `init()` kwargs or environment variables:

| Override                        | Effect                                                                         |
| ------------------------------- | ------------------------------------------------------------------------------ |
| `init(instrument_openai=False)` | extra installed, but don't instrument                                          |
| `ELDROS_INSTRUMENT_OPENAI=true` | force on/off from the environment (same for `_ANTHROPIC`, `_CLAUDE_AGENT_SDK`) |

## How traces relate to turns

If the LLM call happens inside a [`turn()` block](/docs/capture-options), its span **nests under that turn automatically**: one trace per turn, transcript and trace in the same tree, no ids to manage.

```
turn  (input.value / output.value + eldros.message events)
└── gen_ai.chat  (model, tokens, latency, prompt/response)
```

LLM calls *outside* any turn (background summarization, embeddings, classification jobs) are still traced and session-grouped — they just aren't attached to a conversation turn.

## Content & privacy

Prompt and response text is captured **on LLM spans** by default — it's what makes trace-level judging possible. To keep the metrics (model, tokens, latency, errors) but drop the text from LLM spans:

```python theme={null}
eldros_sdk.init(capture_content=False)      # or ELDROS_CAPTURE_CONTENT=false
```

Field-level redaction is available on request.

## Seeing it locally

```python theme={null}
eldros_sdk.init(debug=True)                 # also print spans to the console
```

<Note>
  Everything on this page is the **same pipeline** as transcript capture — one `init()`, one OpenTelemetry export. There is no second integration to add when you want traces.
</Note>
