diff --git a/pkg/datadog/config/config.go b/pkg/datadog/config/config.go index a1e6597312c6..c1b40bd7cef0 100644 --- a/pkg/datadog/config/config.go +++ b/pkg/datadog/config/config.go @@ -133,8 +133,8 @@ func (c *Config) Validate() error { return err } - if c.HostMetadata.ReporterPeriod <= 0 { - return errors.New("reporter_period must be a positive duration") + if c.HostMetadata.ReporterPeriod < 5*time.Minute { + return errors.New("reporter_period must be 5 minutes or higher") } return nil diff --git a/pkg/datadog/config/config_test.go b/pkg/datadog/config/config_test.go index 2d7cde743c54..a76b2b5a5b9b 100644 --- a/pkg/datadog/config/config_test.go +++ b/pkg/datadog/config/config_test.go @@ -190,9 +190,9 @@ func TestValidate(t *testing.T) { name: "Invalid reporter_period", cfg: &Config{ API: APIConfig{Key: "notnull"}, - HostMetadata: HostMetadataConfig{Enabled: true, ReporterPeriod: 0}, + HostMetadata: HostMetadataConfig{Enabled: true, ReporterPeriod: 4 * time.Minute}, }, - err: "reporter_period must be a positive duration", + err: "reporter_period must be 5 minutes or higher", }, } for _, testInstance := range tests {