mirrorkit-go is the Go sibling of the Python and TypeScript collectors. It does exactly one thing: take traces you hand it and send them to Mirrors: batched in the background, non-blocking, and safe (it never panics into your app after Init). It does not instrument SDKs and does not run agents; you build the trace, it ships it.
How do I install the Go collector?
Rungo get github.com/ai-singhal/mirrorkit-go. It requires Go ≥ 1.21 and has
zero dependencies (standard library only).
How do I send traces from a Go agent?
Callmirrorkit.Init once with your workspace key and project, defer
mirrorkit.Shutdown, and call mirrorkit.LogTrace with the messages you want
recorded. Unlike the Python and TypeScript collectors, the Go one does not
instrument SDKs, so you assemble the messages and it handles delivery.
How do I record tool calls in Go?
Build tool-call and tool-result messages with the helpers. Tool calls and their results are the most useful part of a trace, because they are what Mirrors uses to infer your agent’s world:Options
Options.Endpoint → MIRRORKIT_ENDPOINT → MIRROR_ENDPOINT → the production default.
Lifecycle
Init / LogTrace / Flush / Shutdown. For multiple independent collectors, use NewClient and call LogTrace / Flush / Shutdown on the returned *Client.
Each trace is flushed to
{endpoint}/api/collect with Authorization: Bearer <apiKey>. See the collect API reference for the wire format.