telemetry

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client handles telemetry data collection and submission

func NewClient

func NewClient(sdkClient *dotenv.Client, analyticsID string) *Client

NewClient creates a new telemetry client

func (*Client) Close

func (c *Client) Close() error

Close shuts down the telemetry client

func (*Client) IsEnabled

func (c *Client) IsEnabled() bool

IsEnabled returns whether telemetry is enabled

func (*Client) SetEnabled

func (c *Client) SetEnabled(enabled bool)

SetEnabled enables or disables telemetry collection

func (*Client) Track

func (c *Client) Track(name string, properties map[string]interface{}) error

Track records a telemetry event

func (*Client) TrackCommand

func (c *Client) TrackCommand(command string, duration time.Duration, success bool)

TrackCommand tracks a command execution

func (*Client) TrackError

func (c *Client) TrackError(command string, err error)

TrackError tracks an error event with sanitized information

type Collector

type Collector interface {
	Track(event string, properties map[string]interface{}) error
	SetEnabled(enabled bool)
	IsEnabled() bool
}

Collector handles telemetry data collection

type Context

type Context struct {
	OS          string `json:"os"`
	Arch        string `json:"arch"`
	Version     string `json:"version"`
	CI          bool   `json:"ci"`
	SessionID   string `json:"session_id"`
	AnalyticsID string `json:"analytics_id,omitempty"`
}

Context contains telemetry context information

type Event

type Event struct {
	ID         string                 `json:"id"`
	Name       string                 `json:"name"`
	Properties map[string]interface{} `json:"properties"`
	Context    Context                `json:"context"`
	Timestamp  time.Time              `json:"timestamp"`
}

Event represents a telemetry event

Jump to

Keyboard shortcuts

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