telemetry

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const DevtronUniqueClientIdConfigMap = "devtron-ucid"
View Source
const DevtronUniqueClientIdConfigMapKey = "UCID"

Variables

This section is empty.

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 PosthogConfig

type PosthogConfig struct {
	PosthogApiKey           string `env:"POSTHOG_API_KEY" envDefault:""`
	PosthogEndpoint         string `env:"POSTHOG_ENDPOINT" envDefault:"https://app.posthog.com"`
	SummaryInterval         int    `env:"SUMMARY_INTERVAL" envDefault:"24"`
	HeartbeatInterval       int    `env:"HEARTBEAT_INTERVAL" envDefault:"3"`
	CacheExpiry             int    `env:"CACHE_EXPIRY" envDefault:"120"`
	TelemetryApiKeyEndpoint string `env:"TELEMETRY_API_KEY_ENDPOINT" envDefault:"aHR0cHM6Ly90ZWxlbWV0cnkuZGV2dHJvbi5haS9kZXZ0cm9uL3RlbGVtZXRyeS9hcGlrZXk="`
	PosthogEncodedApiKey    string
}

func GetPosthogConfig

func GetPosthogConfig() (*PosthogConfig, 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"`
}

type TelemetryEventClient

type TelemetryEventClient interface {
	GetTelemetryMetaInfo() (*TelemetryMetaInfo, 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 *user.ACDAuthConfig,
	environmentService cluster.EnvironmentService, userService user.UserService,
	appListingRepository repository.AppListingRepository, PosthogClient *PosthogClient,
	ciPipelineRepository pipelineConfig.CiPipelineRepository, pipelineRepository pipelineConfig.PipelineRepository,
	posthogConfig *PosthogConfig) (*TelemetryEventClientImpl, error)

func (*TelemetryEventClientImpl) GetTelemetryMetaInfo added in v0.2.15

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

func (*TelemetryEventClientImpl) HeartbeatEventForTelemetry

func (impl *TelemetryEventClientImpl) HeartbeatEventForTelemetry()

func (*TelemetryEventClientImpl) StopCron

func (impl *TelemetryEventClientImpl) StopCron()

func (*TelemetryEventClientImpl) SummaryEventForTelemetry

func (impl *TelemetryEventClientImpl) 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"`
}

type TelemetryEventType

type TelemetryEventType int
const (
	Heartbeat TelemetryEventType = iota
	InstallationStart
	InstallationSuccess
	InstallationFailure
	UpgradeSuccess
	UpgradeFailure
	Summary
)

func (TelemetryEventType) String

func (d TelemetryEventType) String() string

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