Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes when observer is enabled (prometheus metrics) #907

Open
edulog87 opened this issue Feb 17, 2023 · 1 comment
Open

Crashes when observer is enabled (prometheus metrics) #907

edulog87 opened this issue Feb 17, 2023 · 1 comment

Comments

@edulog87
Copy link

edulog87 commented Feb 17, 2023

Hi,
I'm using Tegola v0.16.0 (and tested with v0.15.x)

I want to enable metrics for Prometheus following documentation (https://pkg.go.dev/github.com/go-spatial/tegola/observability/prometheus#section-readme)

[observer]
type = "prometheus"

When I start tegola it crashes and I get the following error:

panic: duplicate metrics collector registration attempted

goroutine 1 [running]:
github.com/prometheus/client_golang/prometheus.(*Registry).MustRegister(0x0?, {0xc000419d40?, 0x3, 0x0?})
	/go/src/github.com/go-spatial/tegola/vendor/github.com/prometheus/client_golang/prometheus/registry.go:403 +0x7f
github.com/go-spatial/tegola/observability/prometheus.(*observer).MustRegister(0xc00004fce0?, {0xc000419d40?, 0x0?, 0x0?})
	/go/src/github.com/go-spatial/tegola/observability/prometheus/prometheus.go:160 +0x27
github.com/go-spatial/tegola/atlas.(*Atlas).SetObservability(0x1b46680, {0x14d8de0, 0xc00043a500})
	/go/src/github.com/go-spatial/tegola/atlas/atlas.go:269 +0x3a9
github.com/go-spatial/tegola/atlas.SetObservability(...)
	/go/src/github.com/go-spatial/tegola/atlas/atlas.go:337
github.com/go-spatial/tegola/cmd/tegola/cmd.initConfig({0x7ffdbdc55bf1, 0x12}, 0x0, {0xfe09d3, 0x4}, {0xfe5a48?, 0x4?})
	/go/src/github.com/go-spatial/tegola/cmd/tegola/cmd/root.go:152 +0x6b7
github.com/go-spatial/tegola/cmd/tegola/cmd.rootCmdValidatePersistent(0x1ad95e0?, {0xfe0d7f?, 0x2?, 0x2?})
	/go/src/github.com/go-spatial/tegola/cmd/tegola/cmd/root.go:92 +0x169
github.com/go-spatial/cobra.(*Command).execute(0x1ad95e0, {0xc0000c9d00, 0x2, 0x2})
	/go/src/github.com/go-spatial/tegola/vendor/github.com/go-spatial/cobra/command.go:741 +0x58b
github.com/go-spatial/cobra.(*Command).ExecuteC(0x1ad9380)
	/go/src/github.com/go-spatial/tegola/vendor/github.com/go-spatial/cobra/command.go:852 +0x2e5
github.com/go-spatial/cobra.(*Command).Execute(0x46a87b?)
	/go/src/github.com/go-spatial/tegola/vendor/github.com/go-spatial/cobra/command.go:800 +0x19
main.main()
	/go/src/github.com/go-spatial/tegola/cmd/tegola/main.go:13 +0x25

I only declared once that block.
There is a bug or I'm missing some thing ?

thanks

@iwpnd
Copy link
Sponsor Member

iwpnd commented Feb 17, 2023

Hey there 👋

please also share you configuration, otherwise I suspect it to be a duplicate of #886 that is being worked on at #903.

quick fix, either dont use prometheus if you have a multiple map/multi provider setup, or create separate deployments for each.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants