Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Agent] Change monitoring defaults #18226

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ import (

const httpPlusPrefix = "http+"

var defaultMonitoringConfig = monitoringConfig.MonitoringConfig{
Enabled: true,
MonitorLogs: true,
MonitorMetrics: true,
}

type wrappedConfig struct {
MonitoringConfig *monitoringConfig.MonitoringConfig `config:"settings.monitoring" yaml:"settings.monitoring"`
}
Expand All @@ -35,7 +41,7 @@ func NewMonitor(downloadConfig *artifact.Config) *Monitor {
return &Monitor{
operatingSystem: downloadConfig.OS(),
installPath: downloadConfig.InstallPath,
config: &monitoringConfig.MonitoringConfig{},
config: &defaultMonitoringConfig,
Copy link
Contributor Author

@ruflin ruflin May 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michalpristas As this introduces defaults, I wonder if we still need it to be a reference on line 35?

}
}

Expand All @@ -47,7 +53,7 @@ func (b *Monitor) Reload(rawConfig *config.Config) error {
}

if cfg == nil || cfg.MonitoringConfig == nil {
b.config = &monitoringConfig.MonitoringConfig{}
b.config = &defaultMonitoringConfig
} else {
b.config = cfg.MonitoringConfig
}
Expand Down