diff options
author | Ola Aunronning <olaa@yahooinc.com> | 2023-11-13 16:03:05 +0100 |
---|---|---|
committer | Ola Aunronning <olaa@yahooinc.com> | 2023-11-13 16:03:17 +0100 |
commit | f104e24504a28cba0c6d57d98ab4bb9084e17dfa (patch) | |
tree | c3957b102858d9a1620326b92d6c2f5ee089d6b8 /metrics-proxy | |
parent | 7d413afce5949da4dfd25baf8d170acdb7d919d1 (diff) |
NMG is not injectable
Diffstat (limited to 'metrics-proxy')
2 files changed, 7 insertions, 8 deletions
diff --git a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/prometheus/PrometheusHandler.java b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/prometheus/PrometheusHandler.java index aa7ac3356cb..d73561b5eff 100644 --- a/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/prometheus/PrometheusHandler.java +++ b/metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/prometheus/PrometheusHandler.java @@ -5,6 +5,8 @@ import ai.vespa.metricsproxy.core.MetricsConsumers; import ai.vespa.metricsproxy.core.MetricsManager; import ai.vespa.metricsproxy.http.TextResponse; import ai.vespa.metricsproxy.http.ValuesFetcher; +import ai.vespa.metricsproxy.metric.dimensions.ApplicationDimensions; +import ai.vespa.metricsproxy.metric.dimensions.NodeDimensions; import ai.vespa.metricsproxy.metric.model.MetricsPacket; import ai.vespa.metricsproxy.node.NodeMetricGatherer; import ai.vespa.metricsproxy.service.VespaServices; @@ -40,10 +42,11 @@ public class PrometheusHandler extends HttpHandlerBase { MetricsManager metricsManager, VespaServices vespaServices, MetricsConsumers metricsConsumers, - NodeMetricGatherer nodeMetricGatherer) { + ApplicationDimensions applicationDimensions, + NodeDimensions nodeDimensions) { super(executor); valuesFetcher = new ValuesFetcher(metricsManager, vespaServices, metricsConsumers); - this.nodeMetricGatherer = nodeMetricGatherer; + this.nodeMetricGatherer = new NodeMetricGatherer(metricsManager, applicationDimensions, nodeDimensions); } @Override diff --git a/metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/prometheus/PrometheusHandlerTest.java b/metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/prometheus/PrometheusHandlerTest.java index e49a3c2bf50..f8e07c3f2ec 100644 --- a/metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/prometheus/PrometheusHandlerTest.java +++ b/metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/prometheus/PrometheusHandlerTest.java @@ -2,7 +2,6 @@ package ai.vespa.metricsproxy.http.prometheus; import ai.vespa.metricsproxy.http.HttpHandlerTestBase; -import ai.vespa.metricsproxy.node.NodeMetricGatherer; import ai.vespa.metricsproxy.service.DummyService; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -37,7 +36,8 @@ public class PrometheusHandlerTest extends HttpHandlerTestBase { getMetricsManager(), vespaServices, getMetricsConsumers(), - getNodeMetricGatherer()); + getApplicationDimensions(), + getNodeDimensions()); testDriver = new RequestHandlerTestDriver(handler); valuesResponse = testDriver.sendRequest(VALUES_URI).readAll(); } @@ -94,8 +94,4 @@ public class PrometheusHandlerTest extends HttpHandlerTestBase { } throw new IllegalArgumentException("No line containing string: " + searchString); } - - private static NodeMetricGatherer getNodeMetricGatherer() { - return new NodeMetricGatherer(getMetricsManager(), getApplicationDimensions(), getNodeDimensions()); - } } |