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="`
}
func GetPosthogConfig ¶
func GetPosthogConfig() (*PosthogConfig, error)
type PosthogData ¶
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 {
GetClientPlatformIdAndTelemetryUrl() (*PosthogData, 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) GetClientPlatformIdAndTelemetryUrl ¶
func (impl *TelemetryEventClientImpl) GetClientPlatformIdAndTelemetryUrl() (*PosthogData, 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
Click to show internal directories.
Click to hide internal directories.