@Override
    public MetricsReporter createMetricsReporter(URL url) {
        try {
            return new PrometheusMetricsReporter(url, getApplicationModel());
        } catch (NoClassDefFoundError ncde) {
            String msg = ncde.getMessage();
            if (dependenciesNotFound(msg)) {
                logger.error(
                        INTERNAL_ERROR,
                        "",
                        "",
                        "Failed to load class \"org.apache.dubbo.metrics.prometheus.PrometheusMetricsReporter\".",
                        ncde);
                logger.error(
                        INTERNAL_ERROR,
                        "",
                        "",
                        "Defaulting to no-operation (NOP) metricsReporter implementation",
                        ncde);
                logger.error(
                        INTERNAL_ERROR,
                        "",
                        "",
                        "Introduce the micrometer-core package to use the ability of metrics",
                        ncde);
                return new NopPrometheusMetricsReporter();
            } else {
                logger.error(INTERNAL_ERROR, "", "", "Failed to instantiate PrometheusMetricsReporter", ncde);
                throw ncde;
            }
        }
    }
@Test
    void test() {
        ApplicationModel applicationModel = ApplicationModel.defaultModel();
        PrometheusMetricsReporterFactory factory = new PrometheusMetricsReporterFactory(applicationModel);
        MetricsReporter reporter = factory.createMetricsReporter(URL.valueOf("prometheus://localhost:9090/"));

        Assertions.assertTrue(reporter instanceof PrometheusMetricsReporter);
    }