Skip to main content

Installation

Quick Start

What Gets Traced

The integration captures events from the OpenAI Agents SDK’s built-in tracing system:
  • Agent runs — trace-level events with workflow name and metadata
  • LLM generations — model, input messages, output, token usage (input_tokens/output_tokens)
  • Tool/function calls — function name, input arguments, output, duration, and errors
  • Handoffs — from/to agent names for multi-agent workflows (TypeScript only)
  • Errors — captured with error type and message in event properties
  • Finish reason — extracted from response status or generation output (ai.finish_reason)
  • Extended token categories — cached tokens (ai.usage.cached_tokens) and reasoning/thoughts tokens (ai.usage.thoughts_tokens) for OpenAI o1/o3 models
In TypeScript, all spans are linked with parent-child relationships for full trace visibility. In Python, tool calls are tracked as individual tool spans via the Interaction API, and LLM generation data is captured per trace.

Configuration

Projects

Route events to a specific project by passing its slug as projectId (project_id in Python):
This sets the X-Raindrop-Project-Id header on every event. Omit it (or pass "default") to use your org’s default Production project, which is the existing behavior. Single-project orgs need nothing new.

Multiple projects in one process (Python)

Available in raindrop-ai>=0.0.56. Each RaindropOpenAIAgents wrapper owns its own raindrop.Raindrop client, so its manual APIs — flush(), identify(), track_signal() — route to that wrapper’s project independently:
Automatic trace capture is process-global and cannot be split by project. The OpenAI Agents SDK exposes a single, process-global trace-processor registry (add_trace_processor, with no removal API), and auto-captured traces carry no project identity. Raindrop therefore registers one processor per process, and automatic capture follows the most recently constructed wrapper: building a second wrapper with a different project_id redirects all automatic agent traces — including those from agents wired under the first wrapper — to the newer project, and emits a runtime warning. Manual APIs (flush/identify/track_signal) still route per wrapper.For automatic capture, use one project per process. If you must stay in one process, construct a single raindrop.Raindrop and share it via client= so there is no ambiguity about where traces land:
Mixed processes — TypeScript (a tracing-enabled raindrop-ai js-sdk client alongside this integration). If the same Node process also constructs a tracing-enabled raindrop-ai js-sdk client, its Traceloop pipeline auto-instruments the underlying LLM libraries process-wide — so calls made through this integration package additionally produce auto-instrumented spans that route to the js-sdk pipeline owner’s project. This is pre-existing behavior, unrelated to per-instance routing. Run mixed setups with a single project, or scope the integration’s calls with the js-sdk client’s asCurrent().

Identify Users

Associate a user identity with optional traits for analytics:

Track Signals

Attach feedback, labels, or other signals to an existing event:

Multi-Agent Workflows

The integration automatically captures handoffs between agents:

Flushing and Shutdown

Always call flush() before your process exits to ensure all telemetry is shipped:

Known Limitations (Python)

  • Handoffs are not individually captured in the Python SDK. The TypeScript SDK captures full span trees including handoffs.
  • Multi-response traces: In multi-agent workflows with handoffs, only the last response’s data survives per trace.