@@ -78,6 +78,7 @@ type TelemetryEventClientImpl struct {
7878 userAttributesRepository repository.UserAttributesRepository
7979 cloudProviderIdentifierService cloudProviderIdentifier.ProviderIdentifierService
8080 telemetryConfig TelemetryConfig
81+ globalEnvVariables * util.GlobalEnvVariables
8182}
8283
8384type TelemetryEventClient interface {
@@ -96,7 +97,8 @@ func NewTelemetryEventClientImpl(logger *zap.SugaredLogger, client *http.Client,
9697 serverDataStore * serverDataStore.ServerDataStore , userAuditService user2.UserAuditService ,
9798 helmAppClient gRPC.HelmAppClient ,
9899 cloudProviderIdentifierService cloudProviderIdentifier.ProviderIdentifierService , cronLogger * cron3.CronLoggerImpl ,
99- installedAppReadService installedAppReader.InstalledAppReadServiceEA ) (* TelemetryEventClientImpl , error ) {
100+ installedAppReadService installedAppReader.InstalledAppReadServiceEA ,
101+ envVariables * util.EnvironmentVariables ) (* TelemetryEventClientImpl , error ) {
100102 cron := cron .New (
101103 cron .WithChain (cron .Recover (cronLogger )))
102104 cron .Start ()
@@ -118,6 +120,7 @@ func NewTelemetryEventClientImpl(logger *zap.SugaredLogger, client *http.Client,
118120 installedAppReadService : installedAppReadService ,
119121 cloudProviderIdentifierService : cloudProviderIdentifierService ,
120122 telemetryConfig : TelemetryConfig {},
123+ globalEnvVariables : envVariables .GlobalEnvVariables ,
121124 }
122125
123126 watcher .HeartbeatEventForTelemetry ()
@@ -423,7 +426,7 @@ func (impl *TelemetryEventClientImpl) EnqueueGenericPostHogEvent(ucid string, ev
423426 impl .PosthogClient .Client = client
424427 }
425428 }
426- if impl .PosthogClient .Client != nil {
429+ if impl .PosthogClient .Client != nil && ! impl . globalEnvVariables . IsAirGapEnvironment {
427430 err := impl .PosthogClient .Client .Enqueue (posthog.Capture {
428431 DistinctId : ucid ,
429432 Event : eventType ,
0 commit comments