-
Notifications
You must be signed in to change notification settings - Fork 834
Description
According to the prometheus documentation in the below link,
https://prometheus.io/docs/instrumenting/writing_clientlibs/#labels
Metrics with labels SHOULD support a remove() method with the same signature as labels() that will remove a Child from the metric no longer exporting it, and a clear() method that removes all Children from the metric. These invalidate caching of Children.
This seems to be missing in this python library.
my_gauge_metric = Gauge(..)
my_gauage_metric._metrics.clear() would do the job, but I felt little discomfort in using underscore variables outside. Also, its not thread safe since i should have used self._lock
Would be great if this is fixed in the new updates of this library.
Clearing of a particular metric is needed in Guage since the python layer will constatntly give the old Guage values even though its not generated in the latest time.