From 5432fed77b30b27911750d7c8843842638557759 Mon Sep 17 00:00:00 2001 From: Joshua Grimm Date: Sun, 31 May 2020 16:34:20 +0000 Subject: [PATCH] do not report empty playernames as online --- minecraft_exporter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minecraft_exporter.py b/minecraft_exporter.py index 1b4c69a..f911a90 100644 --- a/minecraft_exporter.py +++ b/minecraft_exporter.py @@ -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