public static String makeNameJmxSafe(String str) {
    return str
      .replace(",", "_")
      .replace("=", "_")
      .replace(":", "_")
      .replace("\"", "_")
      .replace("*", "_")
      .replace("?", "_");
  }
Utility class to create JMX related objects
samza-core/src/main/java/org/apache/samza/metrics/JmxUtil.java