Merge pull request #205 from alexgridx/204-fix-error-handling-for-prometheus-in-client-instantiation

#204 fix error handling for prometheus in client instantiation
This commit is contained in:
Alex 2024-09-19 12:15:34 +02:00 committed by GitHub
commit 138b7de381
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -66,12 +66,12 @@ func New(streamName string, opts ...Option) (*Consumer, error) {
} }
if c.metricRegistry != nil { if c.metricRegistry != nil {
var err error var errs error
errors.Join(err, c.metricRegistry.Register(collectorMillisBehindLatest)) errs = errors.Join(errs, c.metricRegistry.Register(collectorMillisBehindLatest))
errors.Join(err, c.metricRegistry.Register(counterEventsConsumed)) errs = errors.Join(errs, c.metricRegistry.Register(counterEventsConsumed))
errors.Join(err, c.metricRegistry.Register(counterCheckpointsWritten)) errs = errors.Join(errs, c.metricRegistry.Register(counterCheckpointsWritten))
if err != nil { if errs != nil {
return nil, err return nil, errs
} }
} }