praefect: Backport separate endpoint for datastore collector (v14.4)
1 unresolved thread
Compare changes
Files
2- John Cai authored
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. Changelog: fixed (cherry picked from commit 90cb7fb7)
+ 23
− 17
@@ -11,21 +11,25 @@ import (
@@ -47,7 +51,9 @@ func NewRepositoryStoreCollector(log logrus.FieldLogger, virtualStorages []strin
@@ -61,7 +67,7 @@ func (c *RepositoryStoreCollector) Collect(ch chan<- prometheus.Metric) {