Documentation
¶
Overview ¶
Package telemetry provides opt-in anonymized telemetry for the goflux library. Users must explicitly call Enable() to activate reporting. No data is sent without explicit user consent.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Enable ¶
func Enable(endpoint, token string)
Enable activates telemetry reporting to the given endpoint. The endpoint should be a URL like "https://goflux-telemetry.your-account.workers.dev/v1/telemetry". An optional bearer token can be provided for basic authentication.
func ReportError ¶
ReportError reports an error occurrence. The actual error message is hashed to protect user privacy. Only the error type and a deterministic hash are sent.
func ReportUsage ¶
ReportUsage reports that a feature was used. This is useful for understanding which indicators, strategies, or utilities are most commonly used.
Types ¶
type Payload ¶
type Payload struct {
V int `json:"v"`
Ts int64 `json:"ts"`
LibVersion string `json:"lib_version"`
GoVersion string `json:"go_version"`
OS string `json:"os"`
Arch string `json:"arch"`
Type string `json:"type"`
Feature string `json:"feature,omitempty"`
ErrorType string `json:"error_type,omitempty"`
ErrorHash string `json:"error_hash,omitempty"`
Context map[string]string `json:"context,omitempty"`
}
Payload represents a single telemetry event.