telemetry

package
v1.12.5-beta001 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIHostLocal            = "local"
	APIHostExternal         = "external"
	APIHostTestkubeInternal = "testkube-internal"
)
View Source
const CloudEnvVariableName = "TESTKUBE_CLOUD_API_KEY"
View Source
const SegmentioEnvVariableName = "TESTKUBE_SEGMENTIO_KEY"

Variables

View Source
var (
	TestkubeMeasurementID     = "" //this is default but it can be set using ldflag -X github.com/kubeshop/testkube/pkg/telemetry.TestkubeMeasurementID=G-B6KY2SF30K
	TestkubeMeasurementSecret = ""
)
View Source
var CloudSegmentioKey = ""
View Source
var SegmentioKey = "jELokNFNcLeQhxdpGF47PcxCtOLpwVuu"

Brew builds can't be parametrized so we are embedding this one

Functions

func AnonymizeHost added in v1.2.34

func AnonymizeHost(host string) string

func GetClusterType added in v1.9.29

func GetClusterType() string

func GetMachineID added in v1.2.34

func GetMachineID() string

GetMachineID returns unique user machine ID

func GoogleAnalyticsSender added in v1.2.34

func GoogleAnalyticsSender(client *http.Client, payload Payload) (out string, err error)

func SegmentioSender added in v1.2.38

func SegmentioSender(client *http.Client, payload Payload) (out string, err error)

SegmentioSender sends ananymous telemetry data to segment.io TODO refactor Sender func as out is not needed (use debug loggers to log output)

func SendCmdEvent added in v1.2.34

func SendCmdEvent(cmd *cobra.Command, version string) (string, error)

SendCmdEvent will send CLI event to GA

func SendCmdInitEvent added in v1.2.34

func SendCmdInitEvent(cmd *cobra.Command, version string) (string, error)

SendCmdInitEvent will send CLI event to GA

func SendCreateEvent added in v1.6.36

func SendCreateEvent(event string, params CreateParams) (string, error)

SendCreateEvent will send API create event for Test or Test suite to GA

func SendHeartbeatEvent added in v1.2.34

func SendHeartbeatEvent(host, version, clusterId string) (string, error)

SendHeartbeatEvent will send CLI event to GA

func SendRunEvent added in v1.6.36

func SendRunEvent(event string, params RunParams) (string, error)

SendCreateEvent will send API run event for Test or Test suite to GA

func SendServerStartEvent added in v1.2.34

func SendServerStartEvent(clusterId, version string) (string, error)

SendServerStartEvent will send event to GA

func TestkubeAnalyticsSender added in v1.2.34

func TestkubeAnalyticsSender(client *http.Client, payload Payload) (out string, err error)

Types

type CreateParams added in v1.6.36

type CreateParams struct {
	AppVersion     string
	DataSource     string
	Host           string
	ClusterID      string
	TestType       string
	TestSource     string
	TestSuiteSteps int32
}

CreateParams contains Test or Test suite creation parameters

type Event added in v1.2.34

type Event struct {
	Name   string `json:"name"`
	Params Params `json:"params,omitempty"`
}

type Params added in v1.2.34

type Params struct {
	EventCount       int64      `json:"event_count,omitempty"`
	EventCategory    string     `json:"event_category,omitempty"`
	AppVersion       string     `json:"app_version,omitempty"`
	AppName          string     `json:"app_name,omitempty"`
	CustomDimensions string     `json:"custom_dimensions,omitempty"`
	DataSource       string     `json:"data_source,omitempty"`
	Host             string     `json:"host,omitempty"`
	MachineID        string     `json:"machine_id,omitempty"`
	ClusterID        string     `json:"cluster_id,omitempty"`
	OperatingSystem  string     `json:"operating_system,omitempty"`
	Architecture     string     `json:"architecture,omitempty"`
	TestType         string     `json:"test_type,omitempty"`
	DurationMs       int32      `json:"duration_ms,omitempty"`
	Status           string     `json:"status,omitempty"`
	TestSource       string     `json:"test_source,omitempty"`
	TestSuiteSteps   int32      `json:"test_suite_steps,omitempty"`
	Context          RunContext `json:"context,omitempty"`
	ClusterType      string     `json:"cluster_type,omitempty"`
}

type Payload added in v1.2.34

type Payload struct {
	UserID   string  `json:"user_id,omitempty"`
	ClientID string  `json:"client_id,omitempty"`
	Events   []Event `json:"events,omitempty"`
}

func NewAPIPayload added in v1.2.34

func NewAPIPayload(clusterId, name, version, host, clusterType string) Payload

func NewCLIPayload added in v1.2.34

func NewCLIPayload(context RunContext, id, name, version, category, clusterType string) Payload

func NewCreatePayload added in v1.6.36

func NewCreatePayload(name, clusterType string, params CreateParams) Payload

NewCreatePayload prepares payload for Test or Test suite creation

func NewRunPayload added in v1.6.36

func NewRunPayload(name, clusterType string, params RunParams) Payload

NewRunPayload prepares payload for Test or Test suite execution

type RunContext added in v1.8.6

type RunContext struct {
	Type           string
	OrganizationId string
	EnvironmentId  string
}

type RunParams added in v1.6.36

type RunParams struct {
	AppVersion string
	DataSource string
	Host       string
	ClusterID  string
	TestType   string
	DurationMs int32
	Status     string
}

RunParams contains Test or Test suite run parameters

type Sender added in v1.2.34

type Sender func(client *http.Client, payload Payload) (out string, err error)

Jump to

Keyboard shortcuts

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