public JmxCollector register() {
        return register(PrometheusRegistry.defaultRegistry);
    }
@Test
    public void testNameAndLabelSanitized() throws Exception {
        new JmxCollector(
                        "\n---\nrules:\n- pattern: `^(hadoop<service=DataNode, )name=DataNodeActivity-ams-hdd001-50010><>replaceBlockOpMinTime:`\n  name: `$1`\n  labels:\n    `$1`: `$1`"
                                .replace('`', '"'))
                .register(prometheusRegistry);
        assertEquals(
                200,
                getSampleValue(
                        "hadoop_service_DataNode_",
                        new String[] {"hadoop_service_DataNode_"},
                        new String[] {"hadoop<service=DataNode, "}),
                .001);
    }