Skip to content

Fix registration of Gitaly metrics dependent on config

Patrick Steinhardt requested to merge pks-gitaly-metrics-registration into master

We've recently grown a metric in Gitaly which is dependent on the configuration in order to set up its buckets. This metric is registered as part of the global variables, but this is wrong as the global configuration will not yet have been read at that point in time. Ideally, we'd do the same as we do for Praefect, where we register and inject metrics in Gitaly's main package. But given that this would require quite some refactoring to do, this is deemed infeasible in the context of this change.

Let's instead fix this by lazily registering metrics via sync.Once.

Edited by Patrick Steinhardt

Merge request reports

Loading