telemetry

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package telemetry sends anonymous usage events to PostHog when the user has opted in. Call Init early, Track per event, and Close before exit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close flushes and shuts down the telemetry client.

func Init

func Init(configDir string)

Init loads telemetry config and opens the PostHog client if allowed.

func IsAllowed

func IsAllowed(cfg Config) bool

func SaveConfig

func SaveConfig(configDir string, cfg Config) error

func Track

func Track(event string, props map[string]any)

Track enqueues an event with the given properties; no-op when telemetry is off.

func TrackCommandFinish

func TrackCommandFinish(command string, durationMs int64, clean bool)

func TrackCommandRun

func TrackCommandRun(command, engine, stack string, modules []string, thin bool)

Types

type Config

type Config struct {
	Enabled     bool   `json:"enabled"`
	AnonymousID string `json:"anonymous_id"`
}

func Disable

func Disable(configDir string) (Config, error)

func Enable

func Enable(configDir string) (Config, error)

func LoadConfig

func LoadConfig(configDir string) Config

Jump to

Keyboard shortcuts

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