telemetry

package
v0.5.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TelemetryApiKeyEndpoint   string = "aHR0cHM6Ly90ZWxlbWV0cnkuZGV2dHJvbi5haS9kZXZ0cm9uL3RlbGVtZXRyeS9wb3N0aG9nSW5mbw=="
	TelemetryOptOutApiBaseUrl string = "aHR0cHM6Ly90ZWxlbWV0cnkuZGV2dHJvbi5haS9kZXZ0cm9uL3RlbGVtZXRyeS9vcHQtb3V0"
	ResponseApiKey            string = "PosthogApiKey"
	ResponseUrlKey            string = "PosthogEndpoint"
)
View Source
const AppsCount int = 50
View Source
const DevtronUniqueClientIdConfigMap = "devtron-ucid"
View Source
const DevtronUniqueClientIdConfigMapKey = "UCID"
View Source
const InstallEventKey = "installEvent"
View Source
const UIEventKey = "uiEventKey"

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 TelemetryEventClient

type TelemetryEventClient interface {
	GetTelemetryMetaInfo() (*TelemetryMetaInfo, error)
	SendTelemetryInstallEventEA() (*TelemetryEventType, error)
	SendTelemetryDashboardAccessEvent() error
	SendTelemetryDashboardLoggedInEvent() 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,
	attributeRepo repository.AttributesRepository, ssoLoginService sso.SSOLoginService,
	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) SendTelemetryDashboardAccessEvent added in v0.3.24

func (impl *TelemetryEventClientImpl) SendTelemetryDashboardAccessEvent() error

func (*TelemetryEventClientImpl) SendTelemetryDashboardLoggedInEvent added in v0.3.24

func (impl *TelemetryEventClientImpl) SendTelemetryDashboardLoggedInEvent() error

func (*TelemetryEventClientImpl) SendTelemetryInstallEventEA added in v0.3.24

func (impl *TelemetryEventClientImpl) SendTelemetryInstallEventEA() (*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, hostURL bool, ssoSetup bool)

func (*TelemetryEventClientImpl) SummaryEventForTelemetryEA added in v0.3.25

func (impl *TelemetryEventClientImpl) SummaryEventForTelemetryEA()

type TelemetryEventClientImplExtended added in v0.3.16

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

func NewTelemetryEventClientImplExtended added in v0.3.25

func 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,
	gitOpsConfigRepository repository.GitOpsConfigRepository, gitProviderRepository repository.GitProviderRepository,
	attributeRepo repository.AttributesRepository, ssoLoginService sso.SSOLoginService, appRepository app.AppRepository,
	ciWorkflowRepository pipelineConfig.CiWorkflowRepository, cdWorkflowRepository pipelineConfig.CdWorkflowRepository,
	dockerArtifactStoreRepository repository.DockerArtifactStoreRepository,
	materialRepository pipelineConfig.MaterialRepository, ciTemplateRepository pipelineConfig.CiTemplateRepository,
	chartRepository chartRepoRepository.ChartRepository) (*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"`
	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"`
	GitAccountsCount                     int                `json:"gitAccountsCount,omitempty"`
	GitOpsCount                          int                `json:"gitOpsCount,omitempty"`
	RegistryCount                        int                `json:"registryCount,omitempty"`
	HostURL                              bool               `json:"hostURL,omitempty"`
	SSOLogin                             bool               `json:"ssoLogin,omitempty"`
	AppCount                             int                `json:"appCount,omitempty"`
	AppsWithGitRepoConfigured            int                `json:"appsWithGitRepoConfigured,omitempty"`
	AppsWithDockerConfigured             int                `json:"appsWithDockerConfigured,omitempty"`
	AppsWithDeploymentTemplateConfigured int                `json:"appsWithDeploymentTemplateConfigured,omitempty"`
	AppsWithCiPipelineConfigured         int                `json:"appsWithCiPipelineConfigured,omitempty"`
	AppsWithCdPipelineConfigured         int                `json:"appsWithCdPipelineConfigured,omitempty"`
	Build                                bool               `json:"build,omitempty"`
	Deployment                           bool               `json:"deployment,omitempty"`
	ServerVersion                        string             `json:"serverVersion,omitempty"`
	DevtronGitVersion                    string             `json:"devtronGitVersion,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"`
	UserCount      int    `json:"userCount,omitempty"`
	ClusterCount   int    `json:"clusterCount,omitempty"`
	HostURL        bool   `json:"hostURL,omitempty"`
	SSOLogin       bool   `json:"ssoLogin,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"
	DashboardAccessed            TelemetryEventType = "DashboardAccessed"
	DashboardLoggedIn            TelemetryEventType = "DashboardLoggedIn"
)

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