do not report empty playernames as online

This commit is contained in:
Joshua Grimm 2020-05-31 16:34:20 +00:00
parent 74d57fc124
commit 5432fed77b

View file

@ -109,7 +109,7 @@ class MinecraftCollector(object):
playerregex = re.compile("players online:(.*)")
if playerregex.findall(resp):
for player in playerregex.findall(resp)[0].split(","):
if player and player != "":
if not player.isspace():
player_online.add_sample('player_online',value=1,labels={'player':player.lstrip()})
return metrics