telemetry

package
v0.48.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package telemetry reports one anonymous usage signal per agentlab command to TelemetryDeck, the way kubectl-gs does: 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. Nothing about the lab — its configuration, users, clusters, 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 it. Reporting never fails a command: the signal travels while the command works, and a command that finishes first waits for it at most half a second (Flush) before the process exits.

Index

Constants

View Source
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

func Command(cmd *cobra.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 Enabled

func Enabled() bool

Enabled reports whether this process sends usage signals.

func Flush added in v0.25.1

func Flush(ctx context.Context)

Flush lets the signal Command sent finish its 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 UserFacing added in v0.20.0

func UserFacing(cmd *cobra.Command) bool

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL