Documentation
¶
Overview ¶
Package telemetry provides opt-out anonymous usage telemetry for unum.
Telemetry is sent via OpenTelemetry (OTLP HTTP) and is disabled when:
- OTEL_EXPORTER_OTLP_ENDPOINT is empty (dev builds)
- DO_NOT_TRACK=1 or UNUM_NO_TELEMETRY=1 is set
- "telemetry": false in config.json
- --no-telemetry CLI flag is used
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Telemetry ¶
type Telemetry struct {
Umami *UmamiClient
// contains filtered or unexported fields
}
Telemetry is the unified facade for all telemetry systems. All methods are safe to call on a nil or disabled instance.
func Init ¶
Init creates a Telemetry instance. If telemetry is disabled (config, env, or missing endpoint), returns a fully functional but no-op instance.
func (*Telemetry) Close ¶
Close flushes pending telemetry data. Should be called before process exit.
func (*Telemetry) Disable ¶
func (t *Telemetry) Disable()
Disable switches telemetry to no-op mode. Called when --no-telemetry is set.
type UmamiClient ¶
type UmamiClient struct {
// contains filtered or unexported fields
}
UmamiClient sends page-level analytics events to a self-hosted Umami instance. Used only in web mode — CLI and TUI telemetry goes through OTel.
func NewUmami ¶
func NewUmami(endpoint, websiteID, hostname string) *UmamiClient
NewUmami creates a client. If endpoint or websiteID is empty, the client is disabled (all methods are no-ops).