private String prometheusSanitizedName(String name) {
        var stringBuilder = new StringBuilder();
        for (char c : name.toCharArray()) {
            if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')) {
                stringBuilder.append(c);
            } else {
                stringBuilder.append("_");
            }
        }
        return stringBuilder.toString();
    }
Produces a flat list of metric entries from a snapshot (which organizes metrics by dimensions)
container-core/src/main/java/com/yahoo/container/jdisc/state/StateHandler.java