diff --git a/puppet/kandra/files/memcached_exporter b/puppet/kandra/files/memcached_exporter index 43eb3ddc88..d39c1ece53 100755 --- a/puppet/kandra/files/memcached_exporter +++ b/puppet/kandra/files/memcached_exporter @@ -382,12 +382,13 @@ class MemcachedCollector(Collector): raw_stats = client.stats("sizes") sizes_stats = next(iter(raw_stats.values())) - if sizes_stats.get("sizes_status") == b"disabled" or sizes_stats == {}: - return - sizes = sorted([int(x) for x in sizes_stats]) - yield gauge( - "item_max_bytes", "Largest item (rounded to 32 bytes) in bytes.", value=sizes[-1] - ) + if sizes_stats.get("sizes_status") != b"disabled" and sizes_stats != {}: + sizes = sorted([int(x) for x in sizes_stats]) + yield gauge( + "item_max_bytes", "Largest item (rounded to 32 bytes) in bytes.", value=sizes[-1] + ) + + client.disconnect_all() if __name__ == "__main__":