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
with self._lock:
if labelvalues not in self._metrics:
self._metrics[labelvalues] = self.__class__(
self._name,
documentation=self._documentation,
labelnames=self._labelnames,
unit=self._unit,
_labelvalues=labelvalues,
**self._kwargs
)
passes the self._name as name parameter in the ctor. The problem is that at this point self._name is actually a full name created by _build_full_name(), for example mynamespace_mysubsystem_mymetric_myunit. Unfortunately, this name undergoes a second round of full name construction. In case of default ctor, where namespace, subsystem and unit all have str = '' default value, this is not a big deal. But if a library user has custom ctor with non-empty default values it causes a pretty weird name to be produced:
Now, in non-multiprocess mode this is not a problem as collector takes the metric name from the parent metric and simply append the child metric labels and values. But multiprocess collector takes what is present in the process files, and those have child metric names.
The text was updated successfully, but these errors were encountered:
The following piece of code from the metrics.py
passes the
self._name
asname
parameter in the ctor. The problem is that at this pointself._name
is actually a full name created by_build_full_name()
, for examplemynamespace_mysubsystem_mymetric_myunit
. Unfortunately, this name undergoes a second round of full name construction. In case of default ctor, where namespace, subsystem and unit all havestr = ''
default value, this is not a big deal. But if a library user has custom ctor with non-empty default values it causes a pretty weird name to be produced:Now, in non-multiprocess mode this is not a problem as collector takes the metric name from the
parent
metric and simply append the child metric labels and values. But multiprocess collector takes what is present in the process files, and those have child metric names.The text was updated successfully, but these errors were encountered: