Skip to main content

Installation

npm

Quick Start

What Gets Traced

  • Agent generate — input prompt, output text, model, token usage (promptTokens/completionTokens)
  • Errors — captured with error status, re-thrown to caller

Configuration

Projects

Route events to a specific project by passing its slug as projectId:
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.

Tool catalog capture (ai.prompt.tools)

Every generate() span records the agent’s registered tool catalog (listTools(), or the legacy tools record) merged with that call’s toolsets and clientTools as ai.prompt.tools; zod inputSchemas are converted to JSON Schema through their Standard JSON Schema interface (zod v4). This is the catalog the agent can hand the model, not the exact per-request list the AI SDK call received — Mastra does not expose that list to the wrapper — so inferred lists carry ai.prompt.tools.source: "mastra.agent.tools". Pass tools on createRaindropMastra(...) to record an exact list instead (it replaces the catalog and carries no source; tools: [] records an empty catalog). See Tool catalog capture for the attribute format, the absent / [] semantics and the override shapes accepted.

Flushing and Shutdown

Application Git identity

createRaindropMastra automatically discovers a reliable application commit in ordinary Node.js runtimes. Use appGit for explicit commitSha, commitDirty, branch, sourceDirectory, detectBranch, or autoDetect settings; pass false to disable enrichment. See the TypeScript Git reference.