You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method restricted_registry works by filtering all metrics once at the time of its creation, as one can see from looking at the file registry.py.
If you register a metric after creating the restriction for it, it is not added to the restricted registry - while the docstring could be interpreted as claiming otherwise.
Solution 1: the class could be documented in a way that makes its behaviour explicit;
Solution 2: the class could be expanded to recollect metrics from its parent on every collect() call.
The text was updated successfully, but these errors were encountered:
I agree, this could be confusing, though the "Intended usage" is hinting that it should be ephemeral to a scrape/output generation. Personally, I would lean slightly towards solution 2 as it is more intuitive and would not require reading the docstring.
…registry collections (#680)
* Made restricted registries call collect() only on relevant collections.
* Added a skip-if for a test that won't run on Python 2.7.
* Moved yielding target_info out of the lock.
* Fixed style and a race condition.
Signed-off-by: Pavel <[email protected]>
The method
restricted_registry
works by filtering all metrics once at the time of its creation, as one can see from looking at the fileregistry.py
.If you register a metric after creating the restriction for it, it is not added to the restricted registry - while the docstring could be interpreted as claiming otherwise.
Solution 1: the class could be documented in a way that makes its behaviour explicit;
Solution 2: the class could be expanded to recollect metrics from its parent on every
collect()
call.The text was updated successfully, but these errors were encountered: