==================
WARNING: DATA RACE
Read at 0x00c0001ab170 by goroutine 27:
main.(*Exporter).collectChans()
/Users/bytedance/opensource/kafka_exporter/kafka_exporter.go:355 +0x366
main.(*Exporter).Collect.func1()
/Users/bytedance/opensource/kafka_exporter/kafka_exporter.go:330 +0x5b
Previous write at 0x00c0001ab170 by goroutine 28:
main.(*Exporter).collectChans.func1()
/Users/bytedance/opensource/kafka_exporter/kafka_exporter.go:347 +0x267
reproduce procedure
output
Previous write at 0x00c0001ab170 by goroutine 28: main.(*Exporter).collectChans.func1() /Users/bytedance/opensource/kafka_exporter/kafka_exporter.go:347 +0x267
Goroutine 27 (running) created at: main.(Exporter).Collect() /Users/bytedance/opensource/kafka_exporter/kafka_exporter.go:330 +0x517 github.com/prometheus/client_golang/prometheus.(Registry).Gather.func1() /Users/bytedance/opensource/kafka_exporter/vendor/github.com/prometheus/client_golang/prometheus/registry.go:455 +0x245
Goroutine 28 (finished) created at: main.(Exporter).collectChans() /Users/bytedance/opensource/kafka_exporter/kafka_exporter.go:345 +0x253 main.(Exporter).Collect.func1() /Users/bytedance/opensource/kafka_exporter/kafka_exporter.go:330 +0x5b