Installation
Quick Start: Interaction API
The Interaction API uses a simple three-step pattern:Begin()– Create an interaction and log the initial user input- Update – Optionally call
SetProperty,SetProperties,SetInput, orAddAttachments Finish()– Record the AI’s final output and close the interaction
Example: Chat Completion
Updating an Interaction
Update an interaction at any point usingSetProperty, SetProperties, SetInput, or AddAttachments:
Resuming an Interaction
If you no longer have the interaction object returned fromBegin(), resume it with ResumeInteraction():
Single-Shot Tracking (TrackAI)
For simple request-response interactions, you can use TrackAI() directly:
We recommend usingUseBegin()→Finish()for new code to take advantage of partial-event buffering, tracing, and upcoming features like automatic token counts.
TrackEvent() for non-AI events:
Tracking Signals (Feedback)
Signals capture quality ratings on AI events. UseTrackSignal() with the same event ID from Begin() or TrackAI():
Identifying Users
Attachments
Attachments let you include additional context—documents, images, code, or embedded content—with your events. They work with bothBegin() interactions and TrackAI() calls.
Configuration
Call
client.Close() before your process exits to flush any buffered events and spans. If writeKey is omitted, the client becomes a no-op instead of failing.
Application Git provenance
raindrop.app.commit_sha, plus raindrop.app.commit_dirty and
raindrop.app.branch when known. Without a selected source directory, Go prefers main-binary VCS
build information, never dependency metadata, then reliable deployment metadata, bounded background
application Git discovery, and provider-marked CI metadata. The first operations may omit metadata
while discovery is pending; event calls, Close(), and flushing do not wait for it. Branch discovery
is opt-in.
Use WithAppGitDisabled() to disable all client enrichment. Setting AutoDetect to a pointer to
false, or setting RAINDROP_GIT_AUTO_DETECT=false, disables automatic sources while retaining
explicit config, canonical operation properties, and RAINDROP_COMMIT_SHA,
RAINDROP_COMMIT_DIRTY, and RAINDROP_BRANCH. WithAppGitDisabled() does not remove canonical
properties explicitly supplied on an operation. RAINDROP_GIT_DETECT_BRANCH=true enables branch
discovery. The explicit values are a full 40- or 64-character hexadecimal SHA, true or
false dirty state, and an ordinary branch string, respectively. Existing canonical operation
properties always win, including invalid values; an overridden SHA does not acquire inferred dirty
or branch values from another source. The properties
are for reporting and filtering only, not simulation checkout selection, release, or SDK identity.
Client config wins over the explicit Raindrop environment values and all automatic sources.
A non-empty SourceDirectory or RAINDROP_GIT_SOURCE_DIRECTORY is made absolute and captured when
the client is initialized. It exclusively selects the automatic AUT checkout after explicit config
and RAINDROP_* identity values. If the repository is unavailable, metadata stays absent; ambient
main-binary, build, deployment, and CI identity is not substituted. Discovery remains background
work, so pending operations omit it without blocking.
This API requires the SDK release containing Git reporting. No version is
documented until that release is published.
Projects
PassWithProjectID to scope every event from a client to a specific project. Under the hood this sets the X-Raindrop-Project-Id header on each request.
^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$).
Omitting WithProjectID (or passing "default") sends to the default Production project, which is the existing behavior, so single-project orgs need nothing here. See Projects for isolation, archival, and the full behavior table.
Tracing
Tracing captures detailed execution information from your AI pipelines—multi-model interactions, chained prompts, and tool calls. This helps you:- Visualize the full execution flow of your AI application
- Debug and optimize prompt chains
- Understand the intermediate steps that led to a response
Using WithSpan
Use WithSpan to trace tasks or operations:
Using WithTool
Use WithTool to trace agent tool calls with automatic input/output capture:
WithTool is a generic function—the return type matches your callback’s return type.
Manual Tool Tracking
For more control over tool span tracking, useTrackTool or StartToolSpan.
TrackTool – Retroactive Logging
Use TrackTool to log a tool call after it has completed:
StartToolSpan – Real-Time Tracking
Use StartToolSpan to track a tool as it executes:
Standalone Tracer
UseTracer() for batch jobs or non-conversation work where you still want spans and tool traces:
Span Attributes
The SDK provides helpers for creating OTLP-compatible attributes:That’s it! You’re ready to explore your events in the Raindrop dashboard. Ping us on Slack or email us if you get stuck!