Skip to content

Commit

Permalink
interval messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc committed Mar 12, 2024
1 parent d72e2b8 commit 957fd72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/csconfig/crowdsec_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ func (c *Config) LoadCrowdsec() error {
func (c *CrowdsecServiceCfg) setMetricsInterval() {
switch {
case c.MetricsInterval == nil:
c.MetricsInterval = ptr.Of(defaultMetricsInterval)
log.Tracef("metrics_interval is not set, default to %s", defaultMetricsInterval)
c.MetricsInterval = ptr.Of(defaultMetricsInterval)
case *c.MetricsInterval == time.Duration(0):
log.Info("metrics_interval is set to 0, disabling metrics")
case *c.MetricsInterval < minimumMetricsInterval:
log.Warnf("metrics_interval is too low (%s), setting it to %s", *c.MetricsInterval, minimumMetricsInterval)
c.MetricsInterval = ptr.Of(minimumMetricsInterval)
log.Warnf("metrics_interval is too low, setting it to %s", minimumMetricsInterval)
default:
log.Tracef("metrics_interval set to %s", c.MetricsInterval)
}
Expand Down

0 comments on commit 957fd72

Please sign in to comment.