telemetry

package
v0.18.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupportedType is returned if the type is not implemented
	ErrUnsupportedType = errors.New("unsupported type")
)
View Source
var (
	SyncerVersion = "dev"
)

Functions

func GetMachineID added in v0.18.0

func GetMachineID(log log.Logger) string

GetMachineID retrieves machine ID and encodes it together with users $HOME path and extra key to protect privacy. Returns a hex-encoded string.

func GetPlatformInstanceID added in v0.18.0

func GetPlatformInstanceID(self *managementv1.Self) string

GetPlatformInstanceID returns the loft instance id

func GetPlatformUserID added in v0.18.0

func GetPlatformUserID(self *managementv1.Self) string

GetPlatformUserID returns the loft instance id

func Start added in v0.18.0

func Start(isCli bool)

Start starts collecting events and sending them to the backend

Types

type ChartInfo added in v0.18.0

type ChartInfo struct {
	Name    string
	Version string

	Values map[string]interface{}
}

type Config added in v0.18.0

type Config struct {
	Disabled           StrBool `json:"disabled,omitempty"`
	InstanceCreator    string  `json:"instanceCreator,omitempty"`
	PlatformUserID     string  `json:"platformUserID,omitempty"`
	PlatformInstanceID string  `json:"platformInstanceID,omitempty"`
	MachineID          string  `json:"machineID,omitempty"`
}

type DefaultCollector

type DefaultCollector struct {
	// contains filtered or unexported fields
}

func NewDefaultCollector

func NewDefaultCollector(config Config, isCli bool) (*DefaultCollector, error)

func (*DefaultCollector) Flush added in v0.18.0

func (d *DefaultCollector) Flush()

func (*DefaultCollector) Init added in v0.18.0

func (d *DefaultCollector) Init(currentNamespaceConfig *rest.Config, currentNamespace string, options *options.VirtualClusterOptions)

func (*DefaultCollector) RecordCLI added in v0.18.0

func (d *DefaultCollector) RecordCLI(self *managementv1.Self, err error)

func (*DefaultCollector) RecordError added in v0.18.0

func (d *DefaultCollector) RecordError(ctx context.Context, severity ErrorSeverityType, err error)

func (*DefaultCollector) RecordStart added in v0.18.0

func (d *DefaultCollector) RecordStart(ctx context.Context)

func (*DefaultCollector) RecordStatus added in v0.18.0

func (d *DefaultCollector) RecordStatus(ctx context.Context)

func (*DefaultCollector) SetVirtualClient

func (d *DefaultCollector) SetVirtualClient(virtualClient *kubernetes.Clientset)

type ErrorSeverityType added in v0.18.0

type ErrorSeverityType string
const (
	ConfigEnvVar = "VCLUSTER_TELEMETRY_CONFIG"

	WarningSeverity ErrorSeverityType = "warning"
	ErrorSeverity   ErrorSeverityType = "error"
	FatalSeverity   ErrorSeverityType = "fatal"
	PanicSeverity   ErrorSeverityType = "panic"
)

type EventCollector

type EventCollector interface {
	RecordStart(ctx context.Context)
	RecordError(ctx context.Context, severity ErrorSeverityType, err error)
	RecordCLI(self *managementv1.Self, err error)

	// Flush makes sure all events are sent to the backend
	Flush()

	Init(currentNamespaceConfig *rest.Config, currentNamespace string, options *options.VirtualClusterOptions)
	SetVirtualClient(virtualClient *kubernetes.Clientset)
}
var (
	Collector EventCollector = &noopCollector{}
)

type KubernetesVersion added in v0.18.0

type KubernetesVersion struct {
	Major      string `json:"major"`
	Minor      string `json:"minor"`
	GitVersion string `json:"gitVersion"`
}

type StrBool added in v0.18.0

type StrBool string

func (*StrBool) UnmarshalJSON added in v0.18.0

func (f *StrBool) UnmarshalJSON(data []byte) error

UnmarshalJSON parses fields that may be numbers or booleans.

Jump to

Keyboard shortcuts

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