Skip to content

Commit

Permalink
fix collectd deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme committed Nov 23, 2023
1 parent 504fdd0 commit d2740e5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 2 additions & 4 deletions internal/signalfx-agent/pkg/core/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,10 @@ type CollectdConfig struct {
// If you won't be using any collectd monitors, this can be set to true to
// prevent collectd from pre-initializing
DisableCollectd bool `yaml:"disableCollectd" default:"false"`
// Deprecated: this setting has no effect and will be removed.
// How many read intervals before abandoning a metric. Doesn't affect much
// in normal usage.
// See [Timeout](https://collectd.org/documentation/manpages/collectd.conf.5.shtml#timeout_iterations).
Timeout int `yaml:"timeout"`
Timeout int `yaml:"timeout" default:"40"`
// Number of threads dedicated to executing read callbacks. See
// [ReadThreads](https://collectd.org/documentation/manpages/collectd.conf.5.shtml#readthreads_num)
ReadThreads int `yaml:"readThreads" default:"5"`
Expand All @@ -241,9 +240,8 @@ type CollectdConfig struct {
// begin being randomly dropped. See
// [WriteQueueLimitLow](https://collectd.org/documentation/manpages/collectd.conf.5.shtml#writequeuelimitlow_lownum)
WriteQueueLimitLow int `yaml:"writeQueueLimitLow" default:"400000"`
// Deprecated: this setting has no effect and will be removed.
// Collectd's log level -- info, notice, warning, or err
LogLevel string `yaml:"logLevel"`
LogLevel string `yaml:"logLevel" default:"notice"`
// A default read interval for collectd plugins. If zero or undefined,
// will default to the global agent interval. Some collectd python
// monitors do not support overridding the interval at the monitor level,
Expand Down
4 changes: 4 additions & 0 deletions pkg/extension/smartagentextension/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ func TestSmartAgentConfigProvider(t *testing.T) {

require.Equal(t, func() saconfig.CollectdConfig {
return saconfig.CollectdConfig{
Timeout: 40,
LogLevel: "notice",
ReadThreads: 1,
WriteThreads: 4,
WriteQueueLimitHigh: 5,
Expand Down Expand Up @@ -154,6 +156,8 @@ func defaultConfig() Config {
RunPath: "/run",
SysPath: "/sys",
Collectd: saconfig.CollectdConfig{
Timeout: 40,
LogLevel: "notice",
ReadThreads: 5,
WriteThreads: 2,
WriteQueueLimitHigh: 500000,
Expand Down
1 change: 0 additions & 1 deletion pkg/receiver/smartagentreceiver/receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ func TestSmartAgentConfigProviderOverrides(t *testing.T) {
return false
}())
require.Equal(t, saconfig.CollectdConfig{
DisableCollectd: false,
Timeout: 10,
ReadThreads: 1,
WriteThreads: 4,
Expand Down

0 comments on commit d2740e5

Please sign in to comment.