def METHOD_NAME(**kwargs: Any) -> PrometheusConfig:
    collectors = list(REGISTRY._collector_to_names.keys())
    for collector in collectors:
        REGISTRY.unregister(collector)
    PrometheusMiddleware._metrics = {}
    return PrometheusConfig(**kwargs)