from typing import Tuple
from typing import Dict


def parse_line_protocol_stat_key(key: str) -> Tuple[str, Dict[str, str]]:
    """Parseline protocolish key to stat prefix and key.

    Examples:
        SNMP_WORKER;hostname=abc.com,worker=snmp-mti
        will become:
        ("SNMP_WORKER", {"hostname": "abc.com", "worker": "snmp-mti"})


    """
    try:
        prefix, raw_labels = key.split(";", 1)
        labels = dict(raw_label.split("=", 1) for raw_label in raw_labels.split(","))
        return prefix, labels
    except ValueError:
        return key, {}