Best way to avoid ValueError: Duplicated timeseries in CollectorRegistry #748
Unanswered
4815162342lost
asked this question in
Q&A
Replies: 1 comment
-
Hello, the best practice is to define the metric name as something static and common. In your example
If your data cannot be modeled in that way I think your solution is as good as any. You will need to keep the metric definitions in state somehow and a dict is a good choice. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have dynamic metric names (new metrics will be added several times in per day). And if i try to create same double metrics i get an Exception:
ValueError: Duplicated timeseries in CollectorRegistry:
But i do not understand, how can i check if metric already exists. Could you please help me?
For example, code:
How can i check that metric already exists and i should not create them.
Currently i am using
But i do not think that it is best solution.
Beta Was this translation helpful? Give feedback.
All reactions