From 0a98da55ebc08d4927ac4e36dbd73b030b455480 Mon Sep 17 00:00:00 2001 From: Gagan Juneja Date: Thu, 5 Oct 2023 21:56:49 +0530 Subject: [PATCH] Add tracer to getTransports (#556) Signed-off-by: Gagan Juneja Co-authored-by: Gagan Juneja (cherry picked from commit 999c6892aa39304f98244203599c325546e4490f) --- .../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 76b0a16e..c0cbb5bc 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; @@ -367,7 +368,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(