Fix: ttl for tags should be default when not provided (now 0).

This commit is contained in:
Hector Sanjuan 2022-01-07 01:02:15 +01:00
parent e22655a3dc
commit 08aea3b3aa

View File

@ -89,8 +89,13 @@ func (cfg *Config) LoadJSON(raw []byte) error {
}
func (cfg *Config) applyJSONConfig(jcfg *jsonConfig) error {
t, _ := time.ParseDuration(jcfg.MetricTTL)
cfg.MetricTTL = t
err := config.ParseDurations(
cfg.ConfigKey(),
&config.DurationOpt{Duration: jcfg.MetricTTL, Dst: &cfg.MetricTTL, Name: "metric_ttl"},
)
if err != nil {
return err
}
cfg.Tags = jcfg.Tags