@classmethod
def parse_carbon(cls, path):
    """parse a carbon path with optional tags: metric;tag=value;..."""
    segments = path.split(';')
    metric = segments[0]
    if not metric:
        raise Exception('Cannot parse path %s, no metric found' % path)
    tags = {}
    for segment in segments[1:]:
        tag = segment.split('=', 1)
        if len(tag) != 2 or not tag[0]:
            raise Exception('Cannot parse path %s, invalid segment %s' % (
                path, segment))
        cls.validateTagAndValue(*tag)
        tags[tag[0]] = tag[1]
    tags['name'] = cls.sanitize_name_as_tag_value(metric)
    return cls(metric, tags)
