From b55383b42ad655be710a6bc9d491ee6df4ae62bb Mon Sep 17 00:00:00 2001 From: William Huang Date: Tue, 9 Oct 2018 15:45:21 +0800 Subject: [PATCH] Remove duplicate code Signed-off-by: William Huang --- prometheus_client/core.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/prometheus_client/core.py b/prometheus_client/core.py index 9c90b1d3..7f1e8a12 100644 --- a/prometheus_client/core.py +++ b/prometheus_client/core.py @@ -219,10 +219,6 @@ def __init__(self, name, documentation, typ, unit=''): if typ not in _METRIC_TYPES: raise ValueError('Invalid metric type: ' + typ) self.type = typ - if unit: - if not name.endswith('_' + unit): - raise ValueError('Metric name does not end with unit: ' + name) - self.unit = unit self.samples = [] def add_sample(self, name, labels, value, timestamp=None, exemplar=None):