Skip to main content

Installation

Quick Start

What Gets Traced

The Bedrock integration automatically captures:
  • Converse API — input messages, output text, model ID, token usage (inputTokens/outputTokens), stop reason, cached token counts
  • InvokeModel API — raw request/response, model ID, token usage (supports Claude, Titan, and Llama response formats), stop reason, cached tokens (Claude)
  • Errors — captured with error status on the span, re-thrown to caller

Captured Properties

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

Available in raindrop-ai>=0.0.56. When one service wraps several Bedrock clients that should report to different projects, create one RaindropBedrock wrapper per project. Each wrapper owns its own raindrop.Raindrop client, so the two route independently — there is no shared module-level state:
Each wrapper owns its configuration and delivery pipeline, so clients handled by different wrappers route independently. To share a single client across wrappers (or with the module-level API), construct a raindrop.Raindrop yourself and pass it via client=:

Using InvokeModel

The wrapper also supports the legacy InvokeModel API. Token usage extraction works with Claude, Titan, and Llama response formats:

Identifying Users

Associate a user with optional traits:

Tracking Signals

Track feedback, edits, or custom signals:

Tool catalog capture (ai.prompt.tools)

TypeScript. Every ConverseCommand span records the command’s toolConfig.tools[].toolSpec as ai.prompt.tools (cache points are not tools and are skipped); Anthropic InvokeModelCommand spans record the request body’s tools (input_schema). Streaming commands are not covered. Pass tools on createRaindropBedrock(...) to record a different list instead (it replaces the inferred one; tools: [] records an empty catalog). Python. raindrop-bedrock ≥ 0.0.11 reads the list off the request itself (the OpenLLMetry Bedrock instrumentation records no tool definitions): every model span under a wrapped converse() / converse_stream() records toolConfig.tools[].toolSpec (cache points are skipped), and Anthropic invoke_model() / invoke_model_with_response_stream() record the body’s tools (input_schema), on sync and async clients alike. Capture is exact. Pass tools= on RaindropBedrock(...) / create_raindrop_bedrock(...) to record a different list for every call through that wrapper (it replaces the inferred one; tools=[] records an empty catalog; the client has no per-call metadata channel, so there is no per-call override). Follows TRACELOOP_TRACE_CONTENT; needs raindrop-ai ≥ 0.0.70 and library instrumentation enabled (disable_auto_instrument=False). See Tool catalog capture for the attribute format, the absent / [] semantics and the override shapes accepted.

Application Git metadata (Python)

RaindropBedrock(...) and create_raindrop_bedrock(...) accept the keyword-only app_git option. It defaults to True: explicit Raindrop Git environment or deployment context is applied immediately, and the base SDK may perform one bounded background local-Git lookup from the process working directory. Event capture, flush, and shutdown never wait for that lookup. Pass False to disable enrichment, or pass an AppGitOptions mapping with commit_sha, commit_dirty, branch, source_directory, detect_branch, and/or auto_detect. Automatic branch discovery remains opt-in through detect_branch=True (or RAINDROP_GIT_DETECT_BRANCH=true). For an ordinary in-process application, the process working directory is treated as the application-under-test checkout. A remote, coding, workflow, or observer process must not rely on its own checkout: pass app_git=False, provide explicit revision values, or set source_directory to the actual application checkout. Canonical per-operation properties remain authoritative. When supplying client=, configure app_git while constructing that Raindrop client; the supplied client is authoritative and the wrapper’s app_git argument does not reconfigure it. Release order is deliberate: first publish the base SDK feature, then publish the wrapper feature release with its minimum dependency coordinated to that base release. The existing raindrop-ai lower bound remains compatible, but application Git metadata is unavailable on an older core and must not be claimed complete until the base is upgraded. Until coordination assigns a released version, the wrapper checks for an explicit base app_git parameter and omits the option when unsupported. Explicit non-default configuration is debug-logged and omitted. Unsupported app_git is determined by signature inspection before construction, not by retrying initialization after a TypeError; Git configuration adds no initialization attempts and does not change any existing framework-specific initialization fallback.

Flushing and Shutdown

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