Documentation
¶
Index ¶
Constants ¶
View Source
const AnnotationSkipInUI = "telemetry.skip-in-ui"
Set on cobra commands the desktop polls frequently so their invocations don't drown out meaningful CLI activity.
Variables ¶
This section is empty.
Functions ¶
func GetMachineID ¶
func GetMachineID() string
HMAC(machine-id, $HOME), hex-encoded. Returns the injected distinct ID when DEVSY_TELEMETRY_DISTINCT_ID is set (desktop-spawned CLI).
func SkipInUIAnnotation ¶ added in v1.3.1
SkipInUIAnnotation returns the cobra Annotations map that flags a command as one the desktop polls frequently.
func WithCollector ¶ added in v1.3.1
func WithCollector(ctx context.Context, c CLICollector) context.Context
Types ¶
type CLICollector ¶
type CLICollector interface {
RecordCLI(err error)
RecordWorkspaceGauge(count int)
SetClient(client devsyclient.BaseWorkspaceClient)
Flush()
}
func ApplyCLIConfig ¶ added in v1.3.1
func ApplyCLIConfig(devsyConfig *config.Config, current CLICollector) CLICollector
Swaps current for a noop collector if the user has opted out via context.
func BootstrapCLI ¶ added in v1.3.1
func BootstrapCLI(cmd *cobra.Command) CLICollector
Call before LoadConfig so config-load failures still get recorded. Always returns a non-nil collector.
func FromContext ¶ added in v1.3.1
func FromContext(ctx context.Context) CLICollector
Returns a noop collector when none is present so callers can use it unguarded.
type ErrorSeverityType ¶
type ErrorSeverityType string
const ( WarningSeverity ErrorSeverityType = "warning" ErrorSeverity ErrorSeverityType = "error" FatalSeverity ErrorSeverityType = "fatal" PanicSeverity ErrorSeverityType = "panic" )
Click to show internal directories.
Click to hide internal directories.