Skip to content

Commit

Permalink
Add tracer to getTransports (#556)
Browse files Browse the repository at this point in the history
Signed-off-by: Gagan Juneja <[email protected]>
Co-authored-by: Gagan Juneja <[email protected]>
(cherry picked from commit 999c689)
  • Loading branch information
Gaganjuneja authored and github-actions[bot] committed Oct 5, 2023
1 parent e5a4a3d commit 0a98da5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -367,7 +368,8 @@ public Map<String, Supplier<Transport>> getTransports(
PageCacheRecycler pageCacheRecycler,
CircuitBreakerService circuitBreakerService,
NamedWriteableRegistry namedWriteableRegistry,
NetworkService networkService) {
NetworkService networkService,
Tracer tracer) {
OpenSearchResources.INSTANCE.setSettings(settings);
OpenSearchResources.INSTANCE.setCircuitBreakerService(circuitBreakerService);
return Collections.emptyMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -154,7 +155,14 @@ public void testCreateComponents() {
@Test
public void testGetTransports() {
Map<String, Supplier<Transport>> 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(
Expand Down

0 comments on commit 0a98da5

Please sign in to comment.