Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Properties ¶
type Properties struct {
Version string `json:"version"`
GoVersion string `json:"go_version"`
OS string `json:"os"`
Arch string `json:"arch"`
DBTypes []string `json:"db_types"`
Services int `json:"service_count"`
Tables int `json:"table_count"`
Admins int `json:"admin_count"`
APIKeys int `json:"api_key_count"`
Roles int `json:"role_count"`
Features []string `json:"features"`
UptimeHrs float64 `json:"uptime_hours"`
}
Properties holds the telemetry payload sent to PostHog.
type PropertiesFunc ¶
type PropertiesFunc func() Properties
PropertiesFunc is called each flush to gather current state.
type SettingsStore ¶
type SettingsStore interface {
GetSetting(ctx context.Context, key string) (string, error)
SetSetting(ctx context.Context, key, value string) error
}
SettingsStore is the interface the telemetry package needs from the config store.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker manages anonymous telemetry reporting to PostHog.
func New ¶
func New(ctx context.Context, store SettingsStore, propsFn PropertiesFunc) *Tracker
New creates a Tracker. It resolves (or generates) the instance ID from the settings store. Returns nil if telemetry is disabled via env var, settings, or if no API key was injected at build time (e.g. dev builds from source).
Click to show internal directories.
Click to hide internal directories.