client_golang icon indicating copy to clipboard operation
client_golang copied to clipboard

The proper way to re initialize metrics

Open robsztal opened this issue 1 year ago • 0 comments

Hey,

I want to reinitialize registered metrics while server is running. What is the proper way? As I understand current logic has to be refactored:

some_metric := prometheus.NewGauge()
prometheus.MustRegister(some_metric)

I saw that I have to refactor it so I have a specific registerer created? And then I just remove it and register a new one ?

Currently I am providing a json file with metrics definitions and it is processed so the metrics are created and registered. Now if I will make a change I want to rerun that process but I saw some issues that you cannot register the same unregistered metric.

robsztal avatar Jan 09 '24 10:01 robsztal