diff --git a/launcher/container_runner.go b/launcher/container_runner.go index ba79e4d3..ba380b1c 100644 --- a/launcher/container_runner.go +++ b/launcher/container_runner.go @@ -129,8 +129,15 @@ func NewRunner(ctx context.Context, cdClient *containerd.Client, token oauth2.To return nil, err } - if err := enableMonitoring(launchSpec.MonitoringEnabled, logger); err != nil { - return nil, err + if launchSpec.MonitoringEnabled == spec.All && !launchSpec.Experiments.EnableHealthMonitoring { + logger.Info("Health Monitoring experiment is not enabled - falling back to memory-only.") + if err := enableMonitoring(spec.MemoryOnly, logger); err != nil { + return nil, err + } + } else { + if err := enableMonitoring(launchSpec.MonitoringEnabled, logger); err != nil { + return nil, err + } } logger.Info(fmt.Sprintf("Launch Policy : %+v\n", launchPolicy)) diff --git a/launcher/internal/experiments/experiments.go b/launcher/internal/experiments/experiments.go index 6547b0f5..c7ef10d4 100644 --- a/launcher/internal/experiments/experiments.go +++ b/launcher/internal/experiments/experiments.go @@ -13,6 +13,7 @@ import ( type Experiments struct { EnableTestFeatureForImage bool EnableTempFSMount bool + EnableHealthMonitoring bool } // New takes a filepath, opens the file, and calls ReadJsonInput with the contents