Skip to content

praefect: do not collect repository store metrics on startup

John Cai requested to merge jc-dont-collect-db-metrics-on-startup into master

Our current code path will trigger the RepositoryStoreCollector to query the database on startup, even if the prometheus listener is not listening. This is because we call DescribeByCollect in the Describe method. The Prometheus client will call Describe on Register, which ends up triggering the Collect method and hence runs the queries. Instead, we can just provide the decriptions separately from the Collect method.

In fact, after !4085 (merged) now the query will potentially run twice on startup because we are registering it with the db_metrics registry, as well as the normal metrics registry.

closes: #3920 (closed)

Edited by John Cai

Merge request reports

Loading