memo-circle-checkFiddler OTel SDK

PyPIarrow-up-right

1.0

1.0.0

March 18, 2026

Initial release of the Fiddler OTel SDK as a standalone package. The core OpenTelemetry instrumentation functionality has been extracted from fiddler-langgraph into this independent package, which now serves as the foundation for all Fiddler framework integrations.

Core classes

  • FiddlerClient: Main client that configures and manages the OTel tracer. Handles OTLP authentication, compression, span limits, sampling, and lifecycle (flush/shutdown). Registers an atexit handler for automatic span flushing.

  • @trace decorator: Automatic function tracing with input/output capture. Supports sync and async functions, all four span types (span, generation, chain, tool), and decorator parameters for model, system, user_id, and version.

  • get_current_span(): Retrieve the active Fiddler span inside a @trace-decorated function as a typed wrapper.

  • get_client(): Retrieve the global FiddlerClient singleton.

Span wrappers

FiddlerSpan (base), FiddlerGeneration, FiddlerChain, FiddlerTool — typed wrappers with semantic convention helpers.

  • FiddlerGeneration: set_model(), set_system(), set_system_prompt(), set_user_prompt(), set_completion(), set_usage(), set_context(), set_messages(), set_output_messages(), set_tool_definitions()

  • FiddlerTool: set_tool_name(), set_tool_input(), set_tool_output(), set_tool_definitions()

  • All wrappers: set_input(), set_output(), set_attribute(), set_agent_name(), set_agent_id(), set_conversation_id(), record_exception(), end()

Context and session

  • set_conversation_id(): Set the conversation ID as a ContextVar that propagates to all spans in the current thread or async task.

  • add_session_attributes(key, value): Attach session-level metadata to all spans in the current thread or async coroutine. Emitted as fiddler.session.user.{key} and automatically propagated from parent to child spans.

  • FiddlerSpanProcessor: OTel SpanProcessor that auto-propagates gen_ai.agent.name, gen_ai.agent.id, gen_ai.conversation.id, session.id, and user.id from parent to child spans.

  • Context isolation: Each FiddlerClient uses its own isolated OTel Context, preventing interference with any existing global tracer in the application.

Configuration and debugging

  • JSONL local capture: jsonl_capture_enabled and jsonl_file_path constructor parameters for local span capture. The FIDDLER_JSONL_FILE environment variable overrides the file path when jsonl_file_path is not set explicitly.

  • Console tracing: console_tracer=True parameter to print spans to stdout during development.

  • Flush and shutdown: force_flush(), shutdown(), aflush(), ashutdown(), and context manager support.

Constants

  • FiddlerSpanAttributes: Constants for all Fiddler OTel span attribute keys.

  • FiddlerResourceAttributes: Constants for Fiddler OTel resource attribute keys.

  • SpanType: Constants for valid fiddler.span.type values.

0.1

0.1.1

March 17, 2026

Pre-release.