Documentation
¶
Overview ¶
Package telemetry reports anonymous usage signals to TelemetryDeck, the way kubectl-gs does. One per agentlab command (Command): which command ran, on which agentlab version, operating system and architecture, under a hashed machine identifier that lets Giant Swarm count users without knowing who they are. And one per platform install (Platform): the meta chart line the lab installs and its feature switches, as versions and booleans. Nothing else about the lab — its users, clusters, paths, arguments or flags — leaves the machine. See docs/telemetry.md.
Setting AGENTLAB_TELEMETRY_OPTOUT (any value) or the console convention DO_NOT_TRACK=1 disables both. Reporting never fails a command: the signals travel while the command works, and a command that finishes first waits for them at most half a second (Flush) before the process exits.
Index ¶
Constants ¶
const ( // OptOutEnv disables usage data collection when set to any value. OptOutEnv = "AGENTLAB_TELEMETRY_OPTOUT" // TestModeEnv files the signals as test data (kept apart from production // numbers in the TelemetryDeck dashboard) and logs delivery errors to // stderr — for developing the lab, and for proving the integration. TestModeEnv = "AGENTLAB_TELEMETRY_TESTMODE" )
Variables ¶
This section is empty.
Functions ¶
func Command ¶
Command records one execution of a user-facing command ("agentlab up"). The HTTP request runs on its own goroutine while the command does its work (Flush, at the end, gives a fast command a bounded moment to see it out), and a failure to deliver is swallowed — telemetry must never get in the user's way. Same shape as kubectl-gs: signal type GiantSwarm.command with the command path and the app version in the payload, plus the OS, architecture and SDK version the library adds. The version and commit also go out as TelemetryDeck.AppInfo.version and .buildNumber (the library's WithAppVersion/WithBuildNumber): those are the parameters the TelemetryDeck dashboard's standard "App Versions" insight reads — the payload's appVersion is what the shared usage report queries.
Not every invocation is a person using the lab: hidden commands are plumbing (__complete runs on every TAB press), `completion` runs on every shell start once sourced from a profile, and `help` is help. None of those count.
func Flush ¶ added in v0.25.1
Flush lets the signals sent so far (Command, Platform) finish their trip before the process exits, waiting at most flushTimeout (and no longer than ctx allows): a sub-second command such as `agentlab version` would otherwise exit before its request has left the machine. Never an error for the caller — a signal that did not make it is dropped, and said so only in test mode.
func Platform ¶ added in v0.51.0
Platform records one install or upgrade of the agent platform: `agentlab up` and `agentlab platform` send it once per run, after the config is loaded and the chart resolved (the dev channel's build picked), so chartVersion is what the run installs. Nothing else sends it — `render`, the proofs and every other command say nothing about the platform.
The payload is the meta chart line and the lab's shape: the exact chart version and its major, the channel the chart comes from (stable, dev or a chart directory), whether the lab renders the legacy 3.x shape, and the feature switches of agentlab.yaml as booleans. Never a path (a chart directory reports the version its Chart.yaml carries, not where it is), a hostname, a user or a token: every value is a version or a bool, so the dashboard can count labs per chart line and channel while nothing in a signal points back at a machine. Same opt-outs, test mode and client as Command, so Flush covers this signal too.
func UserFacing ¶ added in v0.20.0
UserFacing says whether cmd is something a person runs on purpose: not hidden, and not cobra's built-in completion or help trees.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package machineid reads the identifier the operating system keeps for the computer it runs on: `kern.uuid` on macOS, /etc/machine-id on Linux, the registry's MachineGuid on Windows.
|
Package machineid reads the identifier the operating system keeps for the computer it runs on: `kern.uuid` on macOS, /etc/machine-id on Linux, the registry's MachineGuid on Windows. |