Update metrics.py

Replace spaces by underscores to prevent spaces from showing up in metrics token which causes scrape.go to crash
This commit is contained in:
doccodyblue 2021-09-16 11:06:57 +02:00 committed by GitHub
parent 3218e0b8aa
commit 190cd5d641
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,6 +42,7 @@ class Metrics(object):
self.addMetric("openwebrx.users", DirectMetric(ClientRegistry.getSharedInstance().clientCount))
def addMetric(self, name, metric):
name = name.replace(' ','_')
self.metrics[name] = metric
def hasMetric(self, name):