Skip to content

Commit f667d4e

Browse files
authored
Add client-side experiment for NPD Health Monitoring config (google#525)
* add experiment flag for health monitoring * fix log comment
1 parent b249b7f commit f667d4e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

launcher/container_runner.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,15 @@ func NewRunner(ctx context.Context, cdClient *containerd.Client, token oauth2.To
129129
return nil, err
130130
}
131131

132-
if err := enableMonitoring(launchSpec.MonitoringEnabled, logger); err != nil {
133-
return nil, err
132+
if launchSpec.MonitoringEnabled == spec.All && !launchSpec.Experiments.EnableHealthMonitoring {
133+
logger.Info("Health Monitoring experiment is not enabled - falling back to memory-only.")
134+
if err := enableMonitoring(spec.MemoryOnly, logger); err != nil {
135+
return nil, err
136+
}
137+
} else {
138+
if err := enableMonitoring(launchSpec.MonitoringEnabled, logger); err != nil {
139+
return nil, err
140+
}
134141
}
135142

136143
logger.Info(fmt.Sprintf("Launch Policy : %+v\n", launchPolicy))

launcher/internal/experiments/experiments.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
type Experiments struct {
1414
EnableTestFeatureForImage bool
1515
EnableTempFSMount bool
16+
EnableHealthMonitoring bool
1617
}
1718

1819
// New takes a filepath, opens the file, and calls ReadJsonInput with the contents

0 commit comments

Comments
 (0)