diff --git a/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServer.java b/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServer.java index f815ea0ac54..8e5072d197d 100644 --- a/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServer.java +++ b/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServer.java @@ -17,7 +17,6 @@ import io.opentelemetry.sdk.metrics.export.CollectionRegistration; import io.opentelemetry.sdk.metrics.export.MetricReader; import io.prometheus.metrics.exporter.httpserver.HTTPServer; -import io.prometheus.metrics.exporter.httpserver.MetricsHandler; import io.prometheus.metrics.model.registry.PrometheusRegistry; import java.io.IOException; import java.io.UncheckedIOException; @@ -84,7 +83,6 @@ public static PrometheusHttpServerBuilder builder() { .port(port) .executorService(executor) .registry(prometheusRegistry) - .defaultHandler(new MetricsHandler(prometheusRegistry)) .buildAndStart(); } catch (IOException e) { throw new UncheckedIOException("Could not create Prometheus HTTP server", e); diff --git a/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServerTest.java b/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServerTest.java index 449cc4c5c4c..0c91ab7ea72 100644 --- a/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServerTest.java +++ b/exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServerTest.java @@ -229,7 +229,7 @@ void fetchOpenMetrics() { void fetchFiltered() { AggregatedHttpResponse response = client - .get("/?name[]=grpc_name_unit_total&name[]=bears_total&name[]=target_info") + .get("/metrics?name[]=grpc_name_unit_total&name[]=bears_total&name[]=target_info") .aggregate() .join(); assertThat(response.status()).isEqualTo(HttpStatus.OK); @@ -275,7 +275,7 @@ void fetchPrometheusCompressed() throws IOException { @SuppressWarnings("resource") @Test void fetchHead() { - AggregatedHttpResponse response = client.head("/").aggregate().join(); + AggregatedHttpResponse response = client.head("/metrics").aggregate().join(); assertThat(response.status()).isEqualTo(HttpStatus.OK); assertThat(response.headers().get(HttpHeaderNames.CONTENT_TYPE)) .isEqualTo("text/plain; version=0.0.4; charset=utf-8");