Fixed dispatcher metrics registration

Signed-off-by: Marco Pracucci <marco@pracucci.com>
This commit is contained in:
Marco Pracucci 2020-03-06 15:09:30 +01:00
parent 255b2073dc
commit 1f77f320a7
No known key found for this signature in database
GPG Key ID: 74C1BD403D2DF9B5
1 changed files with 5 additions and 1 deletions

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
}