Skip to content

Commit

Permalink
Make KeyVisualizer disabled by default (#1645)
Browse files Browse the repository at this point in the history
  • Loading branch information
smineyev81 authored and baurine committed Feb 28, 2024
1 parent 3982c06 commit 76dd9cf
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
1 change: 1 addition & 0 deletions cmd/tidb-dashboard/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func NewCLIConfig() *DashboardCLIConfig {
flag.BoolVar(&cfg.CoreConfig.EnableExperimental, "experimental", cfg.CoreConfig.EnableExperimental, "allow experimental features")
flag.StringVar(&cfg.CoreConfig.FeatureVersion, "feature-version", cfg.CoreConfig.FeatureVersion, "target TiDB version for standalone mode")
flag.IntVar(&cfg.CoreConfig.NgmTimeout, "ngm-timeout", cfg.CoreConfig.NgmTimeout, "timeout secs for accessing the ngm API")
flag.BoolVar(&cfg.CoreConfig.EnableKeyVisualizer, "keyviz", true, "enable/disable key visualizer(default: true)")

showVersion := flag.BoolP("version", "v", false, "print version information and exit")

Expand Down
30 changes: 16 additions & 14 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,28 @@ type Config struct {
ClusterTLSInfo *transport.TLSInfo // TLS info for mTLS authentication between TiDB components.
TiDBTLSConfig *tls.Config // TLS config for mTLS authentication between TiDB and MySQL client.

EnableTelemetry bool
EnableExperimental bool
FeatureVersion string // assign the target TiDB version when running TiDB Dashboard as standalone mode
EnableTelemetry bool
EnableExperimental bool
EnableKeyVisualizer bool
FeatureVersion string // assign the target TiDB version when running TiDB Dashboard as standalone mode

NgmTimeout int // in seconds
}

func Default() *Config {
return &Config{
DataDir: "/tmp/dashboard-data",
TempDir: "",
PDEndPoint: "http://127.0.0.1:2379",
PublicPathPrefix: defaultPublicPathPrefix,
ClusterTLSConfig: nil,
ClusterTLSInfo: nil,
TiDBTLSConfig: nil,
EnableTelemetry: false,
EnableExperimental: false,
FeatureVersion: version.PDVersion,
NgmTimeout: 30, // s
DataDir: "/tmp/dashboard-data",
TempDir: "",
PDEndPoint: "http://127.0.0.1:2379",
PublicPathPrefix: defaultPublicPathPrefix,
ClusterTLSConfig: nil,
ClusterTLSInfo: nil,
TiDBTLSConfig: nil,
EnableTelemetry: false,
EnableExperimental: false,
EnableKeyVisualizer: true,
FeatureVersion: version.PDVersion,
NgmTimeout: 30, // s
}
}

Expand Down
1 change: 1 addition & 0 deletions pkg/config/dynamic_config_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func (m *DynamicConfigManager) Start(ctx context.Context) error {
dc = &DynamicConfig{}
}
dc.Adjust()
dc.KeyVisual.AutoCollectionDisabled = !m.config.EnableKeyVisualizer

if err := backoff.Retry(func() error { return m.Set(dc) }, bo); err != nil {
log.Error("Failed to start DynamicConfigManager", zap.Error(err))
Expand Down

0 comments on commit 76dd9cf

Please sign in to comment.