src/main/java/com/github/sps/metrics/opentsdb/OpenTsdbMetric.java
public static Builder named(String name) {
		/*
		A name can contain either a pure metric name, or a string returned by encodeTagsInName().
		If it's the latter, it looks like "TAG(tag1=value1 tag2=value2)metricname".
		 */
		if (!hasEncodedTagInName(name)) {
            return new Builder(name);
        }

        // parse out the tags
        int tagEnd = name.lastIndexOf(')');
        if (tagEnd == -1) {
            throw new IllegalArgumentException("Tag definition missing closing parenthesis for metric '" + name + "'");
        }

        String tagString = name.substring(4, tagEnd);
        name = name.substring(tagEnd+1);

        return new Builder(name).withTags(parseTags(tagString));
    }
public static Builder named(String name) {
		/*
		A name can contain either a pure metric name, or a string returned by encodeTagsInName().
		If it's the latter, it looks like "TAG(tag1=value1 tag2=value2)metricname".
		 */
		if (!hasEncodedTagInName(name)) {
            return new Builder(name);
        }

        // parse out the tags
        int tagEnd = name.lastIndexOf(')');
        if (tagEnd == -1) {
            throw new IllegalArgumentException("Tag definition missing closing parenthesis for metric '" + name + "'");
        }

        String tagString = name.substring(4, tagEnd);
        name = name.substring(tagEnd+1);

        return new Builder(name).withTags(parseTags(tagString));
    }
Creates a Builder for a metric name.

@param name name can contain either a pure CodaHale metric name, or a string returned by {@code encodeTagsInName}.
If it's the latter, the tags are parsed out and passed to {@code withTags}.
@return a {@link Builder}