code: public static Map<String, String> instanceIPGroupingKey() throws UnknownHostException {
      Map<String, String> groupingKey = new HashMap<String, String>();
      groupingKey.put("instance", InetAddress.getLocalHost().getHostAddress());
      return groupingKey;
    }
docs: Returns a grouping key with the instance label set to the machine's IP address.
  <p>
  This is a convenience function, and should only be used where you want to
  push per-instance metrics rather than cluster/job level metrics.