Skip to content

Commit

Permalink
uses multierror for metrics sink configuration
Browse files Browse the repository at this point in the history
following @roncodingenthusiast's suggestion
  • Loading branch information
Eclion committed Apr 15, 2024
1 parent 2d21d7f commit f686885
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func ConfigureSinks(cfg *config.TelemetryConfig, memSink metrics.MetricSink) (me
metricsConf.BlockedPrefixes = cfg.BlockedPrefixes

var sinks metrics.FanoutSink
var errors error
var errors *multierror.Error
addSink := func(fn func(*config.TelemetryConfig, string) (metrics.MetricSink, error)) {
s, err := fn(cfg, metricsConf.HostName)
if err != nil {
Expand Down Expand Up @@ -79,12 +79,7 @@ func ConfigureSinks(cfg *config.TelemetryConfig, memSink metrics.MetricSink) (me
}
}

// if no errors where collected, the method should not return
/*if len(errors.Errors) == 0 {
errors = nil
}*/

return sinks, errors
return sinks, errors.ErrorOrNil()
}

// Init configures go-metrics based on map of telemetry config
Expand Down

0 comments on commit f686885

Please sign in to comment.