diff --git a/prometheus_client/__init__.py b/prometheus_client/__init__.py index c650c6d1..416c25c7 100644 --- a/prometheus_client/__init__.py +++ b/prometheus_client/__init__.py @@ -42,7 +42,7 @@ def register(self, collector): with self._lock: self._collectors.add(collector) - def unregister(self, metric): + def unregister(self, collector): '''Remove a collector from the registry.''' with self._lock: self._collectors.remove(collector) @@ -102,7 +102,7 @@ def __init__(self, wrappedClass, labelnames, **kwargs): for l in labelnames: if l.startswith('__'): - raise InvalidLabelName(l) + raise ValueError('Invalid label metric name: ' + l) def labels(self, *labelvalues): '''Return the child for the given labelset.'''