def METHOD_NAME(instance) -> str:
    """Turn a dataclass into Prometheus text format"""
    result = []
    for key, value in asdict(instance).items():
        if value is None:
            # prometheus don't like null value
            continue
        if isinstance(value, dict):
            # Use a constant value of 1 for version, as Prometheus does
            result.append(f"{key}{format_dict_for_prometheus(value)} 1")
        else:
            result.append(f"{key} {json.dumps(value)}")
    return "\n".join(result)