go-spatial / tegola

Tegola is a Mapbox Vector Tile server written in Go
http://tegola.io/
MIT License
1.25k stars 192 forks source link

fix: prometheus with multiple providers #915

Closed iwpnd closed 1 year ago

iwpnd commented 1 year ago

we encountered an issue where tegola would panic if you'd try to register duplicate metrics collectors. that would happen if you have more than one mvt provider in the same config file.

this fix makes provider metrics unique by adding the respective provider name to an array of constant labels. Upon collecting metrics on start up we'd pass unique metrics to the registration step and avoid said panic.

resolves: #886

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 11c27a7f6-PR-915


Changes Missing Coverage Covered Lines Changed/Added Lines %
server/server.go 1 2 50.0%
provider/hana/hana.go 8 20 40.0%
provider/postgis/postgis.go 4 20 20.0%
<!-- Total: 13 42 30.95% -->
Files with Coverage Reduction New Missed Lines %
provider/hana/hana.go 1 55.78%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build f56b286f1: -0.01%
Covered Lines: 6553
Relevant Lines: 13974

💛 - Coveralls
iwpnd commented 1 year ago

@ARolek @gdey

Can I suggest we merge #916 to fix the viewer in CI, then #893 to add the HANA provider and then #915 after I added unique metrics to the HANA provider in #915 as well?

ARolek commented 1 year ago

Can I suggest we merge https://github.com/go-spatial/tegola/pull/916 to fix the viewer in CI, then https://github.com/go-spatial/tegola/pull/893 to add the HANA provider and then https://github.com/go-spatial/tegola/pull/915 after I added unique metrics to the HANA provider in https://github.com/go-spatial/tegola/pull/915 as well?

Yes! I just merged in #916. We will land HANA provider next.

gdey commented 1 year ago

@iwpnd #893 is merged into mainline, when you have a chance, could you rebase, and update the Hana providers as needed?

iwpnd commented 1 year ago

Aight, that should be it. @gdey

Some minor things on the hana provider like casing of errors and unhandled errors. Can you take one last look please?

mrylov commented 1 year ago

Thank you @ARolek, @gdey, @iwpnd for the review!