Closed simbafl closed 11 months ago
resolved
Hello @simbafl,
could you please share how did you solve this issue?
Many thanks
I managed to get around this by creating the metric in a cached function and calling that to access it
from functools import cache
@cache
def get_gauge():
return Gauge("my_gauge", "Gauge", {})
Add() will replace only any metrics with the same metric name and labels within a pushed group. Push() completely removes all previous metrics in a pushed group and then only adds the newly pushed ones.
I want to push the same name metrics in the same batch, and the error is as follows: raise ValueError(f"A collector for {collector.name} is already registered")
So, how should I achieve it?