So perhaps something like:

def formatStats: String = if (clusterStatsObservedByNode.isEmpty) ""
  else ("ClusterStats" +: clusterStatsObservedByNode.map({ case (monitor, stats) => s"${monitor}\t${stats}"})) mkString "\n"