aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/telemetry/metrics.py
diff options
context:
space:
mode:
authorViliam Luc <vluc@cisco.com>2022-04-13 14:00:44 +0200
committerViliam Luc <vluc@cisco.com>2022-09-28 10:28:03 +0000
commita2182abd2665aa9264464a99ad77718e2c7bbe18 (patch)
treeb6552e130c503c0694167ca7485711e776fa2b79 /resources/tools/telemetry/metrics.py
parentbff439b69ee71b654b1da92564ff62de7327fe71 (diff)
telemetry: linux telemetry with perf-stat
Signed-off-by: Viliam Luc <vluc@cisco.com> Change-Id: I17ced17a309cc0ac21c5fc94e570c89a456339e2
Diffstat (limited to 'resources/tools/telemetry/metrics.py')
-rw-r--r--resources/tools/telemetry/metrics.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/resources/tools/telemetry/metrics.py b/resources/tools/telemetry/metrics.py
index 7a22acfd1b..ba6bae5e70 100644
--- a/resources/tools/telemetry/metrics.py
+++ b/resources/tools/telemetry/metrics.py
@@ -104,7 +104,7 @@ class Metric:
u"Sample", [u"name", u"labels", u"value", u"timestamp"]
)
- if not re.compile(r"^[a-zA-Z_:][a-zA-Z0-9_:]*$").match(name):
+ if not re.compile(r"^[a-zA-Z_:\-.][a-zA-Z0-9_:\-.]*$").match(name):
raise ValueError(f"Invalid metric name: {name}!")
if typ not in self.metric_types:
raise ValueError(f"Invalid metric type: {typ}!")
@@ -214,7 +214,7 @@ class MetricBase:
full_name += f"{subsystem}_" if subsystem else u""
full_name += name
- if not re.compile(r"^[a-zA-Z_:][a-zA-Z0-9_:]*$").match(full_name):
+ if not re.compile(r"^[a-zA-Z_:\-.][a-zA-Z0-9_:\-.]*$").match(full_name):
raise ValueError(
f"Invalid metric name: {full_name}!"
)