From e910d0db6152fd7fce1ca894e251a5b1ba3ca98d Mon Sep 17 00:00:00 2001 From: Gagan Juneja Date: Thu, 5 Oct 2023 10:43:47 +0530 Subject: [PATCH] Add tracer to getTransports Signed-off-by: Gagan Juneja --- .../performanceanalyzer/PerformanceAnalyzerPlugin.java | 4 +++- .../PerformanceAnalyzerPluginTests.java | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/opensearch/performanceanalyzer/PerformanceAnalyzerPlugin.java b/src/main/java/org/opensearch/performanceanalyzer/PerformanceAnalyzerPlugin.java index 6c85271f..700b495b 100644 --- a/src/main/java/org/opensearch/performanceanalyzer/PerformanceAnalyzerPlugin.java +++ b/src/main/java/org/opensearch/performanceanalyzer/PerformanceAnalyzerPlugin.java @@ -92,6 +92,7 @@ import org.opensearch.repositories.RepositoriesService; import org.opensearch.rest.RestController; import org.opensearch.script.ScriptService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.Transport; import org.opensearch.transport.TransportInterceptor; @@ -369,7 +370,8 @@ public Map> getTransports( PageCacheRecycler pageCacheRecycler, CircuitBreakerService circuitBreakerService, NamedWriteableRegistry namedWriteableRegistry, - NetworkService networkService) { + NetworkService networkService, + Tracer tracer) { OpenSearchResources.INSTANCE.setSettings(settings); OpenSearchResources.INSTANCE.setCircuitBreakerService(circuitBreakerService); return Collections.emptyMap(); diff --git a/src/test/java/org/opensearch/performanceanalyzer/PerformanceAnalyzerPluginTests.java b/src/test/java/org/opensearch/performanceanalyzer/PerformanceAnalyzerPluginTests.java index 81bbde05..e3045e1a 100644 --- a/src/test/java/org/opensearch/performanceanalyzer/PerformanceAnalyzerPluginTests.java +++ b/src/test/java/org/opensearch/performanceanalyzer/PerformanceAnalyzerPluginTests.java @@ -43,6 +43,7 @@ import org.opensearch.plugins.ActionPlugin.ActionHandler; import org.opensearch.rest.RestController; import org.opensearch.rest.RestHandler; +import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.TestThreadPool; import org.opensearch.threadpool.ThreadPool; @@ -154,7 +155,14 @@ public void testCreateComponents() { @Test public void testGetTransports() { Map> map = - plugin.getTransports(settings, threadPool, null, circuitBreakerService, null, null); + plugin.getTransports( + settings, + threadPool, + null, + circuitBreakerService, + null, + null, + NoopTracer.INSTANCE); assertEquals(0, map.size()); assertEquals(settings, OpenSearchResources.INSTANCE.getSettings()); assertEquals(