Updated to also allow JVM metrics to be sanitized.

- Created new sanitizeName method to take a string to convert into
MetricName and then pass that to the existing santizeName method.