Don't warn if trace_lightstep_reconnect_period is unset
This should silently default to 5m and only warn if we really can't
parse the reconnection period that a user actually tried to set.
@@ -231,7 +231,9 @@ func NewLightStepSpanSink(config *Config, stats *statsd.Client, commonTags map[s
port = lightstepDefaultPort
}
- reconPeriod, err := time.ParseDuration(config.TraceLightstepReconnectPeriod)
+ reconPeriod := lightstepDefaultInterval
+ if config.TraceLightstepReconnectPeriod != "" {
+ reconPeriod, err = time.ParseDuration(config.TraceLightstepReconnectPeriod)
if err != nil {
log.WithError(err).WithFields(logrus.Fields{
"interval": config.TraceLightstepReconnectPeriod,
@@ -239,6 +241,7 @@ func NewLightStepSpanSink(config *Config, stats *statsd.Client, commonTags map[s
}).Warn("Failed to parse reconnect duration, using default.")
reconPeriod = lightstepDefaultInterval
}
+ }
log.WithFields(logrus.Fields{
"Host": host.Hostname(),
