Use the Go trace builder when you want the graph to include application-side runtime work that the provider proxy cannot observe directly.Documentation Index
Fetch the complete documentation index at: https://whyops.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Quickstart
Start with client creation, agent initialization, and your first trace event.
Proxy Transport
Review the Go proxy flow before adding runtime events on top of proxied traffic.
Manual Events API
Compare the Go helpers with the raw REST ingest endpoint and event schema.
Minimal runtime tracing
- Tool span pair
- Thinking block
Prompt caching-aware usage
Hybrid pattern
Use hybrid mode when the proxy already captures the model exchange, but you still want application-side tool timing and output.Self-hosted overrides
Method map
| Method | Purpose | Notes |
|---|---|---|
InitAgent(ctx) | Explicit agent registration | Also runs automatically before first event |
Trace(traceID) | Create a trace builder | Use one trace per session, request, or workflow |
UserMessage() | Log user or assembled prompt input | Optional SystemPrompt, Tools, Params, and ExternalUserID |
LLMResponse() | Log model output | Supports Usage, FinishReason, LatencyMs |
LLMThinking() | Log explicit thinking blocks | Use when the runtime exposes reasoning |
EmbeddingRequest() | Log embedding inputs | Pairs with EmbeddingResponse() |
EmbeddingResponse() | Log embedding result summary | Includes total tokens and latency |
ToolCallRequest() | Start a tool span | Returns spanID |
ToolCallResponse() | Close the tool span | Reuse the spanID from the request |
ToolResult() | Record tool output returned to the model | Useful in hybrid setups |
Error() | Record runtime or provider failure | Supports Status and Stack |
Linking events to users
UseExternalUserID to associate events with your application user IDs:
ExternalUserID is stored on every event and trace, allowing you to filter and analyze traces by your own user identifiers.