praefect: Backport separate endpoint for datastore collector (v14.4)
1 unresolved thread
Compare changes
Files
3- Pavlo Strokov authored
Praefect uses prometheus to export metrics from inside. It relies on the defaults from the prometheus library to gather set of metrics and register a new metrics. Because of it the new metrics got registered on the DefaultRegisterer - a global pre-configured registerer. Because of that we can't call 'run' function multiple times (for testing purposes) as it results to the metrics registration error. To omit that problem the 'run' function extended with prometheus.Registerer parameter that is used to register praefect custom metrics. The production code still uses the same DefaultRegisterer as it was before. And the test code creates a new instance of the registerer for each 'run' invocation, so there are no more duplicates. (cherry picked from commit 81368d46)
+ 8
− 8
@@ -149,7 +149,7 @@ func main() {
@@ -192,18 +192,18 @@ func configure(conf config.Config) {
@@ -390,11 +390,11 @@ func run(cfgs []starter.Config, conf config.Config, b bootstrap.Listener) error
@@ -447,7 +447,7 @@ func run(cfgs []starter.Config, conf config.Config, b bootstrap.Listener) error