-
- Downloads
praefect: Add ability to have separate database metrics endpoint
By default, when metrics are enabled, then each Praefect will expose information about how many read-only repositories there are, which requires Praefect to query the database. First, this will result in the same metrics being exposed by every Praefect given that the database is shared between all of them. And second, this will cause one query per Praefect per scraping run. This cost does add up and generate quite some load on the database, especially so if there is a lot of repositories in that database, up to a point where it may overload the database completely. Fix this issue by splitting metrics which hit the database into a separate endpoint "/db_metrics". This allows admins to set up a separate scraper with a different scraping interval for this metric, and furthermore it gives the ability to only scrape this metric for one of the Praefect instances so the work isn't unnecessarily duplicated. Given that this is a breaking change which will get backported, we must make this behaviour opt-in for now. We thus include a new configuration key "prometheus_use_database_endpoint" which enables the new behaviour such that existing installations' metrics won't break on a simple point release. The intent is to eventually remove this configuration though and enable it for all setups on a major release. Changelog: added (cherry picked from commit 7e74b733)
parent
35844da3
No related branches found
No related tags found
This commit is part of merge request !4096. Comments created here will be created in the context of that merge request.
Showing
- cmd/praefect/main.go 31 additions, 5 deletionscmd/praefect/main.go
- cmd/praefect/subcmd_list_untracked_repositories_test.go 1 addition, 1 deletioncmd/praefect/subcmd_list_untracked_repositories_test.go
- cmd/praefect/subcmd_remove_repository_test.go 1 addition, 1 deletioncmd/praefect/subcmd_remove_repository_test.go
- internal/praefect/config/config.go 10 additions, 4 deletionsinternal/praefect/config/config.go
Please register or sign in to comment