Core OpenTelemetry instrumentation library for Fiddler GenAI observability
Project description
fiddler-otel
Core OpenTelemetry instrumentation library for Fiddler GenAI observability. This is the foundation package used by all Fiddler framework integrations (fiddler-langgraph, fiddler-langchain).
Installation
pip install fiddler-otel
Quick Start
Using the @trace decorator
The simplest way to instrument any Python function — synchronous or async:
from fiddler_otel import FiddlerClient, trace
client = FiddlerClient(
api_key="YOUR_API_KEY",
application_id="YOUR_APPLICATION_ID",
url="https://your-instance.fiddler.ai",
)
@trace(span_type="generation", name="my_llm_call")
def call_llm(prompt: str) -> str:
# your LLM call here
return response
@trace(span_type="chain")
async def run_pipeline(user_input: str) -> str:
result = call_llm(user_input)
return result
Using span wrappers manually
For fine-grained control over span attributes:
from fiddler_otel import FiddlerClient, FiddlerGeneration, FiddlerChain, FiddlerTool
client = FiddlerClient(
api_key="YOUR_API_KEY",
application_id="YOUR_APPLICATION_ID",
url="https://your-instance.fiddler.ai",
)
with client.start_span("my_agent", span_type="chain") as chain_span:
gen = FiddlerGeneration(client.start_span("llm_call"))
with gen as span:
span.set_input("What is the capital of France?")
response = call_llm("What is the capital of France?")
span.set_output(response)
span.set_usage(input_tokens=10, output_tokens=5, total_tokens=15)
Multi-turn Conversations
Link multiple agent invocations into a single conversation:
from fiddler_otel import set_conversation_id
import uuid
set_conversation_id(str(uuid.uuid4()))
# All spans created after this call carry the same conversation_id
result = my_agent(user_message)
Local JSONL Capture
Capture all spans to a local file for debugging without sending to Fiddler:
client = FiddlerClient(
api_key="...",
application_id="...",
url="...",
jsonl_capture_enabled=True,
jsonl_file_path="trace_data.jsonl",
)
Or via environment variables:
FIDDLER_JSONL_ENABLED=true \
FIDDLER_JSONL_FILE=trace_data.jsonl \
python my_agent.py
Console Tracing (Development)
Print all spans to stdout during development:
client = FiddlerClient(
api_key="...",
application_id="...",
url="...",
console_tracer=True,
)
Public API
| Symbol | Description |
|---|---|
FiddlerClient |
Main client — configures the tracer and exports spans to Fiddler |
FiddlerSpan |
Base span wrapper with set_input, set_output, set_attribute |
FiddlerGeneration |
LLM span wrapper — adds set_usage, set_messages, set_context |
FiddlerChain |
Chain/pipeline span wrapper |
FiddlerTool |
Tool call span wrapper |
trace |
Decorator for automatic span creation around any function |
get_current_span |
Get the active Fiddler span inside a traced function |
set_conversation_id |
Link multiple invocations into one conversation |
get_client |
Return the global singleton FiddlerClient |
Context Isolation
fiddler-otel uses its own isolated OpenTelemetry context that does not interfere with any existing global tracer in your application. If you already use OpenTelemetry for infrastructure tracing, Fiddler spans will not appear in your infrastructure traces and vice versa.
Framework Integrations
| Package | Framework | Install |
|---|---|---|
fiddler-langgraph |
LangGraph + LangChain v0.x | pip install fiddler-langgraph |
fiddler-langchain |
LangChain V1 (create_agent) |
pip install fiddler-langchain |
Both integration packages depend on fiddler-otel and re-export its core symbols, so you typically only need to install the integration package for your framework.
Requirements
- Python 3.10+
opentelemetry-api >= 1.27.0opentelemetry-sdk >= 1.27.0opentelemetry-exporter-otlp-proto-http >= 1.27.0pydantic >= 2.0
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fiddler_otel-1.0.0.tar.gz.
File metadata
- Download URL: fiddler_otel-1.0.0.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62c69d26835599108bf32f9e21172d55166d62a0f737c9a106f93e87fc3f1a8d
|
|
| MD5 |
9fe12f23a1f1bc1170161e851a89838f
|
|
| BLAKE2b-256 |
25afe59fb3452a6df008d6902d1e87669d332324dfed6a6b96798aa9941e77fa
|
Provenance
The following attestation bundles were made for fiddler_otel-1.0.0.tar.gz:
Publisher:
publish.yml on fiddler-labs/fiddler-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fiddler_otel-1.0.0.tar.gz -
Subject digest:
62c69d26835599108bf32f9e21172d55166d62a0f737c9a106f93e87fc3f1a8d - Sigstore transparency entry: 1120196714
- Sigstore integration time:
-
Permalink:
fiddler-labs/fiddler-sdk@f90e79d5a8020472c938b074201099c33ad7c10a -
Branch / Tag:
refs/tags/fiddler-otel/v1.0.0 - Owner: https://github.com/fiddler-labs
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish.yml@f90e79d5a8020472c938b074201099c33ad7c10a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file fiddler_otel-1.0.0-py3-none-any.whl.
File metadata
- Download URL: fiddler_otel-1.0.0-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e022c4ab0c0b49d0e49cab64d7ca56b44a5c3ca25836394d704e315aad57edcc
|
|
| MD5 |
3c28f9642883643da7818ea8f00b974e
|
|
| BLAKE2b-256 |
bb95e327477c4599cd0499cb8a23edd9e3a7ee5a229c61a09eb78055bb6edaaf
|
Provenance
The following attestation bundles were made for fiddler_otel-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on fiddler-labs/fiddler-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fiddler_otel-1.0.0-py3-none-any.whl -
Subject digest:
e022c4ab0c0b49d0e49cab64d7ca56b44a5c3ca25836394d704e315aad57edcc - Sigstore transparency entry: 1120196955
- Sigstore integration time:
-
Permalink:
fiddler-labs/fiddler-sdk@f90e79d5a8020472c938b074201099c33ad7c10a -
Branch / Tag:
refs/tags/fiddler-otel/v1.0.0 - Owner: https://github.com/fiddler-labs
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish.yml@f90e79d5a8020472c938b074201099c33ad7c10a -
Trigger Event:
workflow_dispatch
-
Statement type: