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
Runnable example: see
examples/travel_agent.pyfor a complete, traced travel-booking agent using the@tracedecorator.
Using the @trace decorator
The simplest way to instrument any Python function — synchronous or async:
from fiddler_otel import FiddlerClient, trace
client = FiddlerClient(
application_id='YOUR_APPLICATION_ID',
api_key='YOUR_API_KEY',
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(
application_id='YOUR_APPLICATION_ID',
api_key='YOUR_API_KEY',
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
Write spans to a local file in addition to sending them directly to Fiddler. Useful for local debugging or auditing.
Note:
jsonl_capture_enabled=Trueis additive — spans are still exported to Fiddler. To stop direct export, setotlp_enabled=False(see Offline / S3 Routing Mode below).
client = FiddlerClient(
application_id='...',
api_key='...',
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.
Note:
console_tracer=Trueis additive — spans are still exported to Fiddler. It does not suppress direct OTLP export.
client = FiddlerClient(
application_id='...',
api_key='...',
url='...',
console_tracer=True,
)
AWS SageMaker Partner App
When fiddler-otel runs inside an AWS SageMaker Partner Application, OTLP requests can be signed with AWS SigV4 and routed through the SageMaker partner API proxy. The feature is opt-in via environment variables — no code changes are required.
Install the sagemaker extra (already pre-installed in SageMaker-managed runtimes):
pip install "fiddler-otel[sagemaker]"
Then set:
export AWS_PARTNER_APP_AUTH=true
export AWS_PARTNER_APP_ARN=arn:aws:sagemaker:us-east-1:123456789012:partner-app/Partner/app-xyz
export AWS_PARTNER_APP_URL=https://app-xyz.us-east-1.mlapp.sagemaker.aws
AWS credentials are resolved via the standard boto3 credential chain — IAM role inside a SageMaker runtime, ~/.aws/credentials, instance profile, or environment variables. No additional env vars are required when running inside the partner-app sandbox.
When all three AWS_PARTNER_APP_* variables are present, FiddlerClient attaches a SigV4-signing requests.Session to the OTLP exporter. When AWS_PARTNER_APP_AUTH is unset or false, the client behaves exactly as before — no SageMaker dependency is imported.
Offline / S3 Routing Mode
Use otlp_enabled=False to stop all direct OTLP export to Fiddler. Combined with otlp_json_capture_enabled=True, spans are written to local .json files in standard OTLP JSON format (ExportTraceServiceRequest envelope) that can be ingested by the Fiddler S3 connector.
When otlp_enabled=False, api_key and url are not required.
Why is
application_idstill required? Even when not connecting to Fiddler directly,application_idis embedded in every trace file as a resource attribute. The Fiddler S3 connector reads this attribute to route ingested traces to the correct application in your Fiddler account. Obtain the UUID4 from your Fiddler application dashboard.
client = FiddlerClient(
application_id='YOUR_APPLICATION_ID', # from your Fiddler dashboard — embedded in trace files
otlp_enabled=False, # no spans sent directly to Fiddler
otlp_json_capture_enabled=True, # write OTLP JSON files locally
otlp_json_output_dir='./trace_output', # directory for output files (created if absent)
)
Each export batch produces one file named fiddler_trace_<timestamp>_<hex>.json inside otlp_json_output_dir. The directory is created automatically if it does not exist. These files can be uploaded to object storage and ingested by the Fiddler S3 connector without any reformatting.
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.11+
opentelemetry-api >= 1.27.0opentelemetry-sdk >= 1.27.0opentelemetry-exporter-otlp-proto-http >= 1.27.0pydantic >= 2.0
Metadata
Release files for fiddler-otel 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fiddler_otel-1.4.0.tar.gz | 32.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fiddler_otel-1.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 67.3 kB
Release files / fiddler_otel-1.4.0.tar.gz
| Download URL | fiddler_otel-1.4.0.tar.gz |
|---|---|
| Size | 32.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78f0619ca6e7ef238642215e375d12df1e4d9435e76ec169146b7dda89a15a9a
|
|
BLAKE2b-256 checksum How to use checksums |
bf65c8761f26ae1b6c640a981fa3e678a1e3500f533bc9ef4cf78e93d2e212ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.
Transparency logRelease files / fiddler_otel-1.4.0-py3-none-any.whl
| Download URL | fiddler_otel-1.4.0-py3-none-any.whl |
|---|---|
| Size | 35.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0860698df682d5af9724ef69a8a4696f6927f0a0896e61975acc8828fc332b46
|
|
BLAKE2b-256 checksum How to use checksums |
908bb7a2fd4bdccf1b8a9d7c785f5964aa03aea9a3ee4acd1009fa9418294675
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.
Transparency logSecurity for fiddler-otel 1.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for fiddler_otel-1.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.