diff --git a/components/playground/main.go b/components/playground/main.go index f2cece89d3..4ed1533c75 100644 --- a/components/playground/main.go +++ b/components/playground/main.go @@ -75,7 +75,8 @@ var ( const ( mode = "mode" - withoutMonitor = "no-monitor" + withMonitor = "monitor" + withoutMonitor = "without-monitor" // instance numbers db = "db" @@ -297,6 +298,9 @@ If you'd like to use a TiDB version other than %s, cancel and retry with the fol rootCmd.Flags().String(mode, defaultMode, "TiUP playground mode: 'tidb', 'tikv-slim'") rootCmd.Flags().Bool(withoutMonitor, false, "Don't start prometheus and grafana component") + rootCmd.Flags().Bool(withMonitor, true, "Start prometheus and grafana component") + _ = rootCmd.Flags().MarkHidden(withMonitor) + _ = rootCmd.Flags().MarkDeprecated(withMonitor, "Please use --without-monitor to control whether to disable monitor.") rootCmd.Flags().Int(db, defaultOptions.TiDB.Num, "TiDB instance number") rootCmd.Flags().Int(kv, defaultOptions.TiKV.Num, "TiKV instance number") @@ -364,6 +368,11 @@ func populateOpt(flagSet *pflag.FlagSet) (err error) { flagSet.Visit(func(flag *pflag.Flag) { switch flag.Name { + case withMonitor: + options.Monitor, err = strconv.ParseBool(flag.Value.String()) + if err != nil { + return + } case withoutMonitor: options.Monitor, err = strconv.ParseBool(flag.Value.String()) if err != nil {