-
- Downloads
prometheus: Avoid duplicated metrics registration
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)
parent
43031e2d
No related branches found
No related tags found
Please register or sign in to comment