code: private static String getMetricNameWithUniqueId(InstanceType instance, String name) {
      return instance
          + "."
          + NetworkAddressUtils.getLocalHostMetricName(sResolveTimeout)
          + "." + name;
    }
docs: Builds unique metric registry names with unique ID (set to host name). The pattern is
  instance.hostname.metricName.
  
  @param instance the instance name
  @param name the metric name
  @return the metric registry name