telemetry

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandLine

func CommandLine(command string, commandLine []string)

func Error

func Error(inContext string, e error)

Backward compatibility functions - these delegate to the root tracker

func GetClientID

func GetClientID() akid.ClientID

Returns a global ClientID, generated once per CLI instance.

func Init

func Init(loggingEnabled bool)

Initialize the telemetry client. This should be called once at startup either from the root command or from a subcommand that overrides the default PersistentPreRun.

func RateLimitError

func RateLimitError(inContext string, e error)

func Shutdown

func Shutdown()

Flush the telemetry to its endpoint (even buffer size of 1 is not enough if the CLI exits right away.)

func Success

func Success(message string)

func WorkflowStep

func WorkflowStep(workflow string, message string)

Types

type Tracker added in v0.37.3

type Tracker interface {
	// Existing methods (backward compatibility)
	Error(inContext string, e error)
	RateLimitError(inContext string, e error)
	APIError(method string, path string, e error)
	Failure(message string)
	Success(message string)
	WorkflowStep(workflow string, message string)
	CommandLine(command string, commandLine []string)

	// Lifecycle
	Shutdown() error
}

Tracker interface defines the telemetry contract

func Default added in v0.37.3

func Default() Tracker

Default returns the root tracker instance for backward compatibility

func NewScoped added in v0.37.3

func NewScoped(user TrackingUser) Tracker

NewScoped creates a new scoped tracker with different user context

type TrackingUser added in v0.37.3

type TrackingUser struct {
	UserID string
	TeamID string
}

func GetTrackingUserAssociatedWithAPIKey added in v0.37.3

func GetTrackingUserAssociatedWithAPIKey(frontClient rest.FrontClient) (TrackingUser, error)

Get the tracking user associated with the API key

Jump to

Keyboard shortcuts

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