Documentation
¶
Overview ¶
Package telemetry sends a fixed-schema, anonymous usage heartbeat unless it is turned off. It never sees memory content, subjects, predicates, database addresses or keys: callers hand it a tool name and nothing else.
TELEMETRY.md at the repository root lists every field. Keep Payload, that file and the collector's allowlist (polign_telemetry) in step.
Index ¶
Constants ¶
const Endpoint = "https://telemetry.polign.com/v1/recall/ping"
Endpoint is the only destination a heartbeat is sent to.
const Notice = "Recall sends anonymous usage statistics: version, platform, and counts of memory operations, never what is remembered. " +
"See what is sent with `recall telemetry`; turn it off with `recall telemetry off` or RECALL_TELEMETRY=0."
Notice is what a user is told the first time an install ID is created.
Variables ¶
This section is empty.
Functions ¶
func Disabled ¶
Disabled says why telemetry is off for this build, environment and home, or "" when it is on.
Types ¶
type Config ¶
type Config struct {
Version string
Home string // the Recall home directory, where the install ID lives
Mode string
Backend string
Embedder string
Extractor string
Text bool
}
Config describes the process a Reporter speaks for. Embedder and Extractor take the full provider:model spec; only the provider leaves the machine.
type Payload ¶
type Payload struct {
Version string `json:"version"`
OS string `json:"os"`
Arch string `json:"arch"`
InstallID string `json:"install_id"`
// ProcessID is random per run, so the collector can tell one process's
// cumulative counters from the next one's.
ProcessID string `json:"process_id"`
Mode string `json:"mode"` // mcp, serve or setup
Backend string `json:"backend"` // local, polign, qdrant, pgvector, mongodb
Embedder string `json:"embedder"` // provider only: lexical, local, openai, ...
Extractor string `json:"extractor"` // provider only, or none
Surface string `json:"surface"` // text or typed
Client string `json:"client"` // the MCP client's name over stdio, else ""
UptimeSeconds uint64 `json:"uptime_seconds"`
Remembers uint64 `json:"remembers"`
Recalls uint64 `json:"recalls"`
Forgets uint64 `json:"forgets"`
Replacements uint64 `json:"replacements"`
Inspections uint64 `json:"inspections"`
StateCalls uint64 `json:"state_calls"`
// Rollbacks counts State API writes refused with position_behind: the
// caller was restored from an earlier point than its records.
Rollbacks uint64 `json:"rollbacks"`
// Repeats counts State API writes answered with what was already
// recorded under the same message id, call id or outcome.
Repeats uint64 `json:"repeats"`
}
Payload is the complete JSON body of a heartbeat.
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter counts tool calls and reports them from a background loop. A nil Reporter is telemetry turned off, and every method is safe on it.
func Start ¶
Start begins reporting for cfg and returns nil when telemetry is off or the install ID cannot be kept. notice is called once per install, the first time an ID is created. Nothing here blocks on the network.
func (*Reporter) Close ¶
func (r *Reporter) Close()
Close stops the loop and sends the final counters, waiting at most two seconds so a process that is offline still exits promptly.
func (*Reporter) Repeat ¶
func (r *Reporter) Repeat()
Repeat counts one State API write answered with what was already recorded.
func (*Reporter) Rollback ¶
func (r *Reporter) Rollback()
Rollback counts one State API write refused because the caller was restored from an earlier point than its records.
func (*Reporter) SetClient ¶
SetClient records the MCP client's name, as its initialize request gave it.