# Introduction

[![PyPI](https://img.shields.io/pypi/v/fiddler-otel)](https://pypi.org/project/fiddler-otel/)

## Overview

Complete API reference documentation for the `fiddler-otel` package, the framework-agnostic OpenTelemetry-based instrumentation layer for any Python LLM or agent application. `fiddler-otel` is the canonical source for Fiddler's span attributes, conversation tracking, and span processing primitives; the LangChain, LangGraph, and Strands SDKs build on top of it and re-export several of its symbols.

```bash
pip install fiddler-otel
```

```python
from fiddler_otel import FiddlerClient, trace
```

## Components

### Attributes

Span and resource attribute helpers. `set_conversation_id` and `add_session_attributes` are propagated through the current trace context; `FiddlerSpanAttributes`, `FiddlerResourceAttributes`, and `SpanType` enumerate the constant keys Fiddler recognizes.

* [add\_session\_attributes](/api/fiddler-otel-sdk/attributes/add-session-attributes.md)
* [FiddlerResourceAttributes](/api/fiddler-otel-sdk/attributes/fiddler-resource-attributes.md)
* [FiddlerSpanAttributes](/api/fiddler-otel-sdk/attributes/fiddler-span-attributes.md)
* [set\_conversation\_id](/api/fiddler-otel-sdk/attributes/set-conversation-id.md)
* [SpanType](/api/fiddler-otel-sdk/attributes/span-type.md)

### Client

Client initialization and configuration. `FiddlerClient` wires the OTLP exporter, span processor, and resource attributes into the global tracer provider; `get_client` returns the active singleton.

* [FiddlerClient](/api/fiddler-otel-sdk/client/fiddler-client.md)
* [get\_client](/api/fiddler-otel-sdk/client/get-client.md)

### Decorators

Function-level tracing helpers. `@trace` instruments arbitrary Python functions; `get_current_span` returns the active span for attribute mutation inside a traced call.

* [get\_current\_span](/api/fiddler-otel-sdk/decorators/get-current-span.md)
* [trace](/api/fiddler-otel-sdk/decorators/trace.md)

### JSONL Capture

JSONL span exporter for offline analysis. Writes a structured trace record per span to a local file alongside (or instead of) OTLP export, useful for debugging and reproducing customer issues.

* [JSONLSpanExporter](/api/fiddler-otel-sdk/jsonl-span-exporter.md)

### Span Processor

Custom OpenTelemetry span processor that enriches outgoing spans with Fiddler resource attributes before export.

* [FiddlerSpanProcessor](/api/fiddler-otel-sdk/fiddler-span-processor.md)

### Span Wrapper

Manual span creation primitives for code paths that don't fit the decorator model. `FiddlerSpan` is the base; `FiddlerChain`, `FiddlerGeneration`, and `FiddlerTool` carry semantic conventions for retrieval/agent steps, LLM calls, and tool invocations.

* [FiddlerChain](/api/fiddler-otel-sdk/span-wrapper/fiddler-chain.md)
* [FiddlerGeneration](/api/fiddler-otel-sdk/span-wrapper/fiddler-generation.md)
* [FiddlerSpan](/api/fiddler-otel-sdk/span-wrapper/fiddler-span.md)
* [FiddlerTool](/api/fiddler-otel-sdk/span-wrapper/fiddler-tool.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fiddler.ai/api/fiddler-otel-sdk/otel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
