null instanceof String is always false.  So the check below really should always be that the metric name is empty.  This is also very minor.