I noticed that when you change the descriptors and edit the collect method of the Exporter struct, sometimes the last metric is being ignored. I realized that a small time.Sleep (like 100us) before line number 350 in kafka_exporter.go can fix the problem.
Finally I've found out that [sometimes] when the e.collect(original) is called and returned, the original channel is closed before the last metric is added to container array.
A channel (as a flag) can fix the problem, to wait before iterating the e.sgChans until the for loop exits in line number 344.
Let me know if you think I'm wrong or doing something wrong :)
I noticed that when you change the descriptors and edit the collect method of the Exporter struct, sometimes the last metric is being ignored. I realized that a small time.Sleep (like 100us) before line number 350 in kafka_exporter.go can fix the problem.
Finally I've found out that [sometimes] when the e.collect(original) is called and returned, the original channel is closed before the last metric is added to container array.
A channel (as a flag) can fix the problem, to wait before iterating the e.sgChans until the for loop exits in line number 344.
Let me know if you think I'm wrong or doing something wrong :)