telemetry

package
v0.3.23 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TelemetryApiKeyEndpoint   string = "aHR0cHM6Ly90ZWxlbWV0cnkuZGV2dHJvbi5haS9kZXZ0cm9uL3RlbGVtZXRyeS9hcGlrZXk="
	TelemetryOptOutApiBaseUrl string = "aHR0cHM6Ly90ZWxlbWV0cnkuZGV2dHJvbi5haS9kZXZ0cm9uL3RlbGVtZXRyeS9vcHQtb3V0"
)
View Source
const DevtronUniqueClientIdConfigMap = "devtron-ucid"
View Source
const DevtronUniqueClientIdConfigMapKey = "UCID"
View Source
const InstallEventKey = "installEvent"

Variables

View Source
var (
	PosthogApiKey        string = ""
	PosthogEndpoint      string = "https://app.posthog.com"
	SummaryCronExpr      string = "0 0 * * *" // Run once a day, midnight
	HeartbeatCronExpr    string = "0 0/6 * * *"
	CacheExpiry          int    = 1440
	PosthogEncodedApiKey string = ""
	IsOptOut             bool   = false
)

Functions

This section is empty.

Types

type PosthogClient

type PosthogClient struct {
	Client posthog.Client
	// contains filtered or unexported fields
}

func NewPosthogClient

func NewPosthogClient(logger *zap.SugaredLogger) (*PosthogClient, error)

type SummaryDto

type SummaryDto struct {
	ProdAppCount            int    `json:"prodAppCount,omitempty"`
	NonProdAppCount         int    `json:"nonProdAppCount,omitempty"`
	UserCount               int    `json:"userCount,omitempty"`
	EnvironmentCount        int    `json:"environmentCount,omitempty"`
	ClusterCount            int    `json:"clusterCount,omitempty"`
	CiCountPerDay           int    `json:"ciCountPerDay,omitempty"`
	CdCountPerDay           int    `json:"cdCountPerDay,omitempty"`
	HelmChartCount          int    `json:"helmChartCount,omitempty"`
	SecurityScanCountPerDay int    `json:"securityScanCountPerDay,omitempty"`
	DevtronVersion          string `json:"devtronVersion,omitempty"`
}

type SummaryEA added in v0.3.16

type SummaryEA struct {
	UserCount    int `json:"userCount,omitempty"`
	ClusterCount int `json:"clusterCount,omitempty"`
}

type TelemetryEventClient

type TelemetryEventClient interface {
	GetTelemetryMetaInfo() (*TelemetryMetaInfo, error)
	SendTelemtryInstallEventEA() (*TelemetryEventType, error)
}

type TelemetryEventClientImpl

type TelemetryEventClientImpl struct {
	K8sUtil *util2.K8sUtil

	PosthogClient *PosthogClient
	// contains filtered or unexported fields
}

func NewTelemetryEventClientImpl

func NewTelemetryEventClientImpl(logger *zap.SugaredLogger, client *http.Client, clusterService cluster.ClusterService,
	K8sUtil *util2.K8sUtil, aCDAuthConfig *util3.ACDAuthConfig, userService user.UserService,
	PosthogClient *PosthogClient) (*TelemetryEventClientImpl, error)

func (*TelemetryEventClientImpl) EnqueuePostHog added in v0.3.16

func (impl *TelemetryEventClientImpl) EnqueuePostHog(ucid string, eventType TelemetryEventType, prop map[string]interface{}) error

func (*TelemetryEventClientImpl) GetTelemetryMetaInfo added in v0.2.15

func (impl *TelemetryEventClientImpl) GetTelemetryMetaInfo() (*TelemetryMetaInfo, error)

func (*TelemetryEventClientImpl) HeartbeatEventForTelemetry

func (impl *TelemetryEventClientImpl) HeartbeatEventForTelemetry()

func (*TelemetryEventClientImpl) SendTelemtryInstallEventEA added in v0.3.16

func (impl *TelemetryEventClientImpl) SendTelemtryInstallEventEA() (*TelemetryEventType, error)

func (*TelemetryEventClientImpl) StopCron

func (impl *TelemetryEventClientImpl) StopCron()

func (*TelemetryEventClientImpl) SummaryDetailsForTelemetry added in v0.3.16

func (impl *TelemetryEventClientImpl) SummaryDetailsForTelemetry() (cluster []cluster.ClusterBean, user []bean.UserInfo, k8sServerVersion *version.Info)

func (*TelemetryEventClientImpl) SummaryEventForTelemetry

func (impl *TelemetryEventClientImpl) SummaryEventForTelemetry()

type TelemetryEventClientImplExtended added in v0.3.16

type TelemetryEventClientImplExtended struct {
	*TelemetryEventClientImpl
	// contains filtered or unexported fields
}

func (*TelemetryEventClientImplExtended) NewTelemetryEventClientImplExtended added in v0.3.16

func (impl *TelemetryEventClientImplExtended) NewTelemetryEventClientImplExtended(logger *zap.SugaredLogger, client *http.Client, clusterService cluster.ClusterService,
	K8sUtil *util2.K8sUtil, aCDAuthConfig *util3.ACDAuthConfig,
	environmentService cluster.EnvironmentService, userService user.UserService,
	appListingRepository repository.AppListingRepository, PosthogClient *PosthogClient,
	ciPipelineRepository pipelineConfig.CiPipelineRepository, pipelineRepository pipelineConfig.PipelineRepository) (*TelemetryEventClientImplExtended, error)

func (*TelemetryEventClientImplExtended) SummaryEventForTelemetry added in v0.3.16

func (impl *TelemetryEventClientImplExtended) SummaryEventForTelemetry()

type TelemetryEventDto

type TelemetryEventDto struct {
	UCID           string             `json:"ucid"` //unique client id
	Timestamp      time.Time          `json:"timestamp"`
	EventMessage   string             `json:"eventMessage,omitempty"`
	EventType      TelemetryEventType `json:"eventType"`
	Summary        *SummaryDto        `json:"summary,omitempty"`
	ServerVersion  string             `json:"serverVersion,omitempty"`
	DevtronVersion string             `json:"devtronVersion,omitempty"`
	DevtronMode    string             `json:"devtronMode,omitempty"`
}

type TelemetryEventEA added in v0.3.16

type TelemetryEventEA struct {
	UCID           string             `json:"ucid"` //unique client id
	Timestamp      time.Time          `json:"timestamp"`
	EventMessage   string             `json:"eventMessage,omitempty"`
	EventType      TelemetryEventType `json:"eventType"`
	Summary        *SummaryEA         `json:"summary,omitempty"`
	ServerVersion  string             `json:"serverVersion,omitempty"`
	DevtronVersion string             `json:"devtronVersion,omitempty"`
	DevtronMode    string             `json:"devtronMode,omitempty"`
}

type TelemetryEventType

type TelemetryEventType string
const (
	Heartbeat                    TelemetryEventType = "Heartbeat"
	InstallationStart            TelemetryEventType = "InstallationStart"
	InstallationInProgress       TelemetryEventType = "InstallationInProgress"
	InstallationInterrupt        TelemetryEventType = "InstallationInterrupt"
	InstallationSuccess          TelemetryEventType = "InstallationSuccess"
	InstallationFailure          TelemetryEventType = "InstallationFailure"
	UpgradeStart                 TelemetryEventType = "UpgradeStart"
	UpgradeInProgress            TelemetryEventType = "UpgradeInProgress"
	UpgradeInterrupt             TelemetryEventType = "UpgradeInterrupt"
	UpgradeSuccess               TelemetryEventType = "UpgradeSuccess"
	UpgradeFailure               TelemetryEventType = "UpgradeFailure"
	Summary                      TelemetryEventType = "Summary"
	InstallationApplicationError TelemetryEventType = "InstallationApplicationError"
)

type TelemetryMetaInfo added in v0.2.15

type TelemetryMetaInfo struct {
	Url    string `json:"url,omitempty"`
	UCID   string `json:"ucid,omitempty"`
	ApiKey string `json:"apiKey,omitempty"`
}

Jump to

Keyboard shortcuts

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