Documentation ¶
Index ¶
Constants ¶
const ControlTelemetryEnv = "RHOAS_TELEMETRY"
ControlTelemetryEnv is name of environment variable, if set to false it disables telemetry completely hiding even the question
const Sanitizer = "XXXX"
Sanitizer replaces a PII data
Variables ¶
This section is empty.
Functions ¶
func GetUserIdentity ¶
func GetUserIdentity(client *TelemetryClient, telemetryFilePath string) (string, error)
GetUserIdentity returns the anonymous ID if it exists, else creates a new one and sends the data to Segment
func SanitizeError ¶
SanitizeError sanitizes any PII(Personally Identifiable Information) from the error
Types ¶
type Telemetry ¶
type Telemetry struct {
// contains filtered or unexported fields
}
Telemetry structure
func CreateTelemetry ¶
Start collecting telemetry data
type TelemetryClient ¶
type TelemetryClient struct { // SegmentClient helps interact with the segment API SegmentClient analytics.Client // TelemetryFilePath points to the file containing anonymousID used for tracking odo commands executed by the user TelemetryFilePath string }
TelemetryClient client used to send data to Segment
func NewClient ¶
func NewClient() (*TelemetryClient, error)
NewClient returns a Client created with the default args
func (*TelemetryClient) Close ¶
func (c *TelemetryClient) Close() error
Close client connection and send the data
func (*TelemetryClient) Upload ¶
func (c *TelemetryClient) Upload(data *TelemetryData) error
Upload prepares the data to be sent to segment and send it once the client connection closes
type TelemetryData ¶
type TelemetryData struct { Event string `json:"event"` Properties TelemetryProperties `json:"properties"` }
TelemetryData contains all of the data that is sent to Segment for telemetry
type TelemetryProperties ¶
type TelemetryProperties struct { Duration int64 `json:"duration"` Error string `json:"error"` Success bool `json:"success"` TTY bool `json:"tty"` Version string `json:"version"` OS string `json:"os"` }
TelemetryProperties contains all of the properties that are sent as the telemetry data