Skip to main content
The Strands Agents integration instruments the Strands Agent SDK via its hook system to capture agent invocations, model calls, tool usage, and token metrics. Features:
  • No OpenTelemetry setup required
  • Automatic input/output capture from agent invocations
  • Model call tracking with token usage
  • Tool call span tracking
  • Works with both TypeScript and Python SDKs

Installation

Quick Start


What Gets Traced

The Strands integration automatically captures:
  • Agent invocations — input prompt (last user message), output text, model name
  • Token usage — prompt_tokens, completion_tokens, and cached_tokens (from Bedrock/Anthropic cacheReadInputTokens / cacheCreationInputTokens)
  • Model calls — output and usage extracted from each model call within an invocation
  • Tool call spans — individual tool spans tracked via interaction.track_tool() with name, input, output, duration (ms), and error
  • Finish reasonstop_reason or finish_reason from model responses (e.g., end_turn, tool_use), included in properties as strands.finish_reason
  • Errors — captured and re-raised; telemetry failures never crash your pipeline

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 runs several Strands agents that should report to different projects, create one RaindropStrands 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 agents 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=:

Identifying Users


Signals (Feedback)

Track user feedback on AI responses:

Flush & Shutdown

Always flush before your process exits to ensure all data is sent:

Captured Properties

The following properties are automatically included in tracked events:
PropertyDescription
ai.usage.prompt_tokensInput token count
ai.usage.completion_tokensOutput token count
ai.usage.cached_tokensCached input tokens (Bedrock/Anthropic)
strands.finish_reasonModel stop reason (e.g., end_turn, tool_use)
error.typeException class name (when an error occurs)
error.messageError message text (truncated to 500 chars)

Token Tracking

The integration automatically captures token usage from model responses:
PropertyDescription
ai.usage.prompt_tokensInput token count (inputTokens from Strands model response)
ai.usage.completion_tokensOutput token count (outputTokens from Strands model response)
ai.usage.cached_tokensCached input tokens (prefers cacheReadInputTokens, falls back to cacheCreationInputTokens)
Tokens are extracted from both individual model call responses (stop_response.usage) and accumulated metrics (result.metrics.accumulated_usage).

Finish Reason

The model’s stop reason is captured automatically and included in event properties as strands.finish_reason. The integration checks stop_reason first (Bedrock convention), then falls back to finish_reason.

Factory Function

A create_raindrop_strands() factory is available for convenience:

Known Limitations

  • Streaming: The integration captures the final result of each model call. Streaming token-by-token output is not individually traced.
  • Multi-agent: Each agent needs its own registerHooks() / register_hooks() call. Nested agent hierarchies are not automatically linked.
  • Python WeakRef: The Python handler uses id(agent) for internal tracking since some agent-like objects don’t support weak references. Context is cleaned up explicitly after each invocation.

That’s it! You’re ready to explore your Strands agent events in the Raindrop dashboard. Ping us on Slack or email us if you get stuck!