def METHOD_NAME(params: BaseSilenceParams) -> str:
    if params.alertmanager_url:
        return params.alertmanager_url
    if "grafana" == params.alertmanager_flavor:
        return ServiceDiscovery.find_url(
            selectors=["app.kubernetes.io/name=grafana"], error_msg="Failed to find grafana url"
        )
    return AlertManagerDiscovery.find_alert_manager_url()