Documentation
¶
Index ¶
Constants ¶
const AppID = "ca9654da-ba0e-489c-ba2a-f81990c2f826"
Variables ¶
var ( ErrNotEnabled = errors.New("telemetry is not enabled on this device") ErrAlreadyInitialized = errors.New("already initialized telemetry") )
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func FromContext ¶
func NewFromEnv ¶
func NewFromEnv(executor executor.CommandRunner) (*Client, error)
NewFromEnv initializes the telemetry tracker with the configured collector URI and user information. Returns ErrAlreadyInitialized if called more than once, or an error if user ID generation fails. Returns ErrNotEnabled if telemetry is not enabled.
func (*Client) FlushEvents ¶
func (c *Client) FlushEvents()
FlushEvents flushes any pending telemetry events and stops the emitter. Does nothing if the emitter has not been initialized.
func (*Client) IsTeamMember ¶
IsTeamMember returns true if we can reasonably assume that the user is a GitLab team member. It intentionally doesn't report errors and fails fast to avoid complaining to users, who aren't team members.
This should only be used for telemetry and NEVER for authentication.
The logic is based on GDK's `GDK::Telemetry.team_member?` function.