telemetry

package
v0.8.0-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: MIT Imports: 16 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

Index

Constants

View Source
const (
	// TelemetryDisabledEnvVar is the environment variable that disables telemetry when set
	TelemetryDisabledEnvVar = "CRE_TELEMETRY_DISABLED"

	// TelemetryDebugEnvVar is the environment variable that enables debug logging for telemetry
	TelemetryDebugEnvVar = "CRE_TELEMETRY_DEBUG"
)

Variables

This section is empty.

Functions

func EmitCommandEvent

func EmitCommandEvent(cmd *cobra.Command, exitCode int, runtimeCtx *runtime.Context)

EmitCommandEvent emits a user event for command execution This function is completely silent and never blocks command execution

func SendEvent

func SendEvent(ctx context.Context, event UserEventInput, creds *credentials.Credentials, envSet *environments.EnvironmentSet, logger *zerolog.Logger)

SendEvent sends a user event to the GraphQL endpoint All errors are silently swallowed unless debug logging is enabled

Types

type CommandInfo

type CommandInfo struct {
	Action     string `json:"action"`
	Subcommand string `json:"subcommand,omitempty"`
}

CommandInfo contains information about the executed command

func CollectCommandInfo

func CollectCommandInfo(cmd *cobra.Command) CommandInfo

CollectCommandInfo extracts command information from a cobra command

type MachineInfo

type MachineInfo struct {
	OsName       string `json:"osName"`
	OsVersion    string `json:"osVersion"`
	Architecture string `json:"architecture"`
}

MachineInfo contains information about the machine running the CLI

func CollectMachineInfo

func CollectMachineInfo() MachineInfo

CollectMachineInfo gathers information about the machine running the CLI

type ReportUserEventResponse

type ReportUserEventResponse struct {
	ReportUserEvent struct {
		Success bool   `json:"success"`
		Message string `json:"message"`
	} `json:"reportUserEvent"`
}

ReportUserEventResponse represents the response from the reportUserEvent mutation

type UserEventInput

type UserEventInput struct {
	CliVersion string      `json:"cliVersion"`
	ExitCode   int         `json:"exitCode"`
	Command    CommandInfo `json:"command"`
	Machine    MachineInfo `json:"machine"`
}

UserEventInput represents the input for reporting a user event

Jump to

Keyboard shortcuts

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