같은 메트릭은 등록 패스

This commit is contained in:
2023-11-28 22:40:48 +09:00
parent e5a5240f96
commit 5787a384f9

View File

@ -103,6 +103,10 @@ func (pe *prometheusExporter) loop() {
case nm := <-pe.registerChan:
var nextmetrics map[string]*prometheusMetricDesc
if collector != nil {
if collector.metrics[nm.key] != nil {
break
}
nextmetrics = collector.metrics
prometheus.Unregister(collector)
nextmetrics[nm.key] = nm