Closed EmreKumas closed 1 year ago
hi @EmreKumas sorry to hear that and thank you for your contribution.
we will publish a fix π
Thank you for your support, weβre waiting this fix π btw we tried to unregister all prometheus collectors but after that we faced fiber prometheus metric problem also fyi.
Hello @firatferoglu we've implemented a fix but I got confused about what you guys tried. how did you try to unregister collectors? is that similar to what we did below?
Yes, it looks similar. We edited the code in the vendor folder and unregistered prometheus collectors.
I also try this branch locally but, same error still exists :(
I changed unregisterMetricCollectors() method as below.
func (s *dcp) unregisterMetricCollectors() {
for i := range s.metricCollectors {
result := prometheus.DefaultRegisterer.Unregister(s.metricCollectors[i])
fmt.Println(result)
}
s.metricCollectors = []prometheus.Collector{}
}
And observed that the metric is created in api.NewMetricCollector() method couldn't be unregistered.
Thank you for the information. We should investigate the library and find a proper solution. I will update here if I find the reason and solution.
Hello @firatferoglu we have released a new version v1.0.3. Thanks for help π
Brilliant, thank you for your support π
Describe the bug We want to implement a dynamic configuration system in which after updating the config, the connector needs to be closed and started again. But we're getting "duplicate metrics collector registration attempted" error when the second connector is registering its prometheus metric connector.
To Reproduce Create a connector, start it, close it. Then create a new connector and start it.
Expected behavior While closing the connector, it should unregister all prometheus collectors which causes the duplicate error.
Stack Trace