-
Notifications
You must be signed in to change notification settings - Fork 842
-
https://github.com/prometheus/client_python/blob/master/prometheus_client/gc_collector.py
Should default collectors re-use already created instance of metric? Why it creates it again and again?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
It's not much work to create new instances of the metric and allows the collector itself not to keep any state or locking logic. Not applicable to the gc collector specifically, but the pattern of recreating all metrics also makes sure that old values are not kept forever when an underlying resource is deleted.
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment