diff --git a/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/internal/PrometheusCustomizerProvider.java b/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/internal/PrometheusCustomizerProvider.java deleted file mode 100644 index f657e14eea7..00000000000 --- a/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/internal/PrometheusCustomizerProvider.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ - -package io.opentelemetry.exporter.prometheus.internal; - -import io.opentelemetry.exporter.prometheus.PrometheusHttpServer; -import io.opentelemetry.exporter.prometheus.PrometheusHttpServerBuilder; -import io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer; -import io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider; -import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; - -/** - * SPI implementation for {@link PrometheusHttpServer}. - * - *

This class is internal and is hence not for public use. Its APIs are unstable and can change - * at any time. - */ -public class PrometheusCustomizerProvider implements AutoConfigurationCustomizerProvider { - - @Override - public void customize(AutoConfigurationCustomizer autoConfiguration) { - autoConfiguration.addMeterProviderCustomizer( - (builder, config) -> { - boolean prometheusEnabled = - config.getList("otel.metrics.exporter").contains("prometheus"); - if (prometheusEnabled) { - builder.registerMetricReader(configurePrometheusHttpServer(config)); - } - return builder; - }); - } - - // Visible for test - static PrometheusHttpServer configurePrometheusHttpServer(ConfigProperties config) { - PrometheusHttpServerBuilder prometheusBuilder = PrometheusHttpServer.builder(); - - Integer port = config.getInt("otel.exporter.prometheus.port"); - if (port != null) { - prometheusBuilder.setPort(port); - } - String host = config.getString("otel.exporter.prometheus.host"); - if (host != null) { - prometheusBuilder.setHost(host); - } - return prometheusBuilder.build(); - } -} diff --git a/exporters/prometheus/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider b/exporters/prometheus/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider deleted file mode 100644 index 1522bd5c348..00000000000 --- a/exporters/prometheus/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider +++ /dev/null @@ -1 +0,0 @@ -io.opentelemetry.exporter.prometheus.internal.PrometheusCustomizerProvider \ No newline at end of file