Merge pull request #2200 from pracucci/fix-dispatcher-metrics

Fixed dispatcher metrics registration
This commit is contained in:
Julien Pivotto 2020-03-06 22:43:13 +01:00 committed by GitHub
commit 99e5cbff40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,7 +53,11 @@ func NewDispatcherMetrics(r prometheus.Registerer) *DispatcherMetrics {
},
),
}
prometheus.MustRegister(m.aggrGroups, m.processingDuration)
if r != nil {
r.MustRegister(m.aggrGroups, m.processingDuration)
}
return &m
}