chop-dbhi / prometheus-sql

Service that exposes Prometheus metrics for a SQL result set.
BSD 2-Clause "Simplified" License
202 stars 55 forks source link

panic: duplicate metrics collector registration attempted #52

Closed ratheesh-kr closed 2 years ago

ratheesh-kr commented 5 years ago

We are having a problem with a query. We get an error "panic: duplicate metrics collector registration attempted". The actual record count is 1000. If we limit to 100 the query runs perfectly.

panic: duplicate metrics collector registration attempted panic: duplicate metrics collector registration attempted panic: duplicate metrics collector registration attempted

goroutine 27 [running]: app/vendor/github.com/prometheus/client_golang/prometheus.(Registry).MustRegister(0xc42007c440, 0xc420387a60, 0x1, 0x1) /go/src/app/vendor/github.com/prometheus/client_golang/prometheus/registry.go:404 +0x9e app/vendor/github.com/prometheus/client_golang/prometheus.MustRegister(0xc420387a60, 0x1, 0x1) /go/src/app/vendor/github.com/prometheus/client_golang/prometheus/registry.go:152 +0x53 main.(QueryResult).RegisterMetrics.func1(0xc420071280, 0x77, 0x91f280, 0xc42049e800) /go/src/app/set.go:158 +0x13e panic(0x7438c0, 0xc42027b380) /usr/local/go/src/runtime/panic.go:491 +0x283 app/vendor/github.com/prometheus/client_golang/prometheus.(Registry).MustRegister(0xc42007c440, 0xc420387510, 0x1, 0x1) /go/src/app/vendor/github.com/prometheus/client_golang/prometheus/registry.go:404 +0x9e app/vendor/github.com/prometheus/client_golang/prometheus.MustRegister(0xc420387510, 0x1, 0x1) /go/src/app/vendor/github.com/prometheus/client_golang/prometheus/registry.go:152 +0x53 main.(QueryResult).RegisterMetrics.func1(0xc42046fd80, 0x7b, 0x91f280, 0xc420469380) /go/src/app/set.go:158 +0x13e panic(0x7438c0, 0xc42027ac60) /usr/local/go/src/runtime/panic.go:491 +0x283 app/vendor/github.com/prometheus/client_golang/prometheus.(Registry).MustRegister(0xc42007c440, 0xc420386fb0, 0x1, 0x1) /go/src/app/vendor/github.com/prometheus/client_golang/prometheus/registry.go:404 +0x9e app/vendor/github.com/prometheus/client_golang/prometheus.MustRegister(0xc420386fb0, 0x1, 0x1) /go/src/app/vendor/github.com/prometheus/client_golang/prometheus/registry.go:152 +0x53 main.(QueryResult).RegisterMetrics.func1(0xc420442b00, 0x7a, 0x91f280, 0xc42043c300) /go/src/app/set.go:158 +0x13e main.(QueryResult).RegisterMetrics(0xc42014a540, 0xc4203cc390) /go/src/app/set.go:162 +0x27c main.(Worker).SetMetrics(0xc42013c2a0, 0xc42039c000, 0x2c4, 0x2c7) /go/src/app/worker.go:46 +0xf0 main.(Worker).Fetch(0xc42013c2a0, 0x7ffe258f6ea5, 0x14, 0x0, 0x0, 0x0, 0x0, 0x0) /go/src/app/worker.go:117 +0x900 main.(Worker).Start.func1() /go/src/app/worker.go:124 +0x45 main.(*Worker).Start(0xc42013c2a0, 0x7ffe258f6ea5, 0x14) /go/src/app/worker.go:131 +0x77 created by main.main /go/src/app/main.go:93 +0x70e

haxorof commented 4 years ago

This might have been resolved in latest version just recently built. Please check if this still is relevant for you or close the issue.

haxorof commented 2 years ago

Create new issue if you still have the problem in latest version.