diff --git a/CHANGELOG.md b/CHANGELOG.md index 337573480adfd..42c6d9dcb8bcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -94,6 +94,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Allow parameterization of tests with OpenSearchIntegTestCase.SuiteScopeTestCase annotation ([#9916](https://github.com/opensearch-project/OpenSearch/pull/9916)) - Mute the query profile IT with concurrent execution ([#9840](https://github.com/opensearch-project/OpenSearch/pull/9840)) - Add instrumentation in transport service. ([#10042](https://github.com/opensearch-project/OpenSearch/pull/10042)) +- Add instrumentation in transport action. ([#10096](https://github.com/opensearch-project/OpenSearch/pull/10096)) ### Deprecated diff --git a/client/client-benchmark-noop-api-plugin/src/main/java/org/opensearch/plugin/noop/action/bulk/TransportNoopBulkAction.java b/client/client-benchmark-noop-api-plugin/src/main/java/org/opensearch/plugin/noop/action/bulk/TransportNoopBulkAction.java index 77d4d3d095b29..9d27863982b49 100644 --- a/client/client-benchmark-noop-api-plugin/src/main/java/org/opensearch/plugin/noop/action/bulk/TransportNoopBulkAction.java +++ b/client/client-benchmark-noop-api-plugin/src/main/java/org/opensearch/plugin/noop/action/bulk/TransportNoopBulkAction.java @@ -43,6 +43,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.index.shard.ShardId; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; public class TransportNoopBulkAction extends HandledTransportAction { @@ -53,8 +54,8 @@ public class TransportNoopBulkAction extends HandledTransportAction { @Inject - public TransportNoopSearchAction(TransportService transportService, ActionFilters actionFilters) { - super(NoopSearchAction.NAME, transportService, actionFilters, (Writeable.Reader) SearchRequest::new); + public TransportNoopSearchAction(TransportService transportService, ActionFilters actionFilters, Tracer tracer) { + super(NoopSearchAction.NAME, transportService, actionFilters, (Writeable.Reader) SearchRequest::new, tracer); } @Override diff --git a/modules/ingest-common/src/main/java/org/opensearch/ingest/common/GrokProcessorGetAction.java b/modules/ingest-common/src/main/java/org/opensearch/ingest/common/GrokProcessorGetAction.java index 9c79a06a45f58..f8c44ee2329fc 100644 --- a/modules/ingest-common/src/main/java/org/opensearch/ingest/common/GrokProcessorGetAction.java +++ b/modules/ingest-common/src/main/java/org/opensearch/ingest/common/GrokProcessorGetAction.java @@ -49,6 +49,7 @@ import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; import java.io.IOException; @@ -134,13 +135,13 @@ public static class TransportAction extends HandledTransportAction sortedGrokPatterns; @Inject - public TransportAction(TransportService transportService, ActionFilters actionFilters) { - this(transportService, actionFilters, Grok.BUILTIN_PATTERNS); + public TransportAction(TransportService transportService, ActionFilters actionFilters, Tracer tracer) { + this(transportService, actionFilters, Grok.BUILTIN_PATTERNS, tracer); } // visible for testing - TransportAction(TransportService transportService, ActionFilters actionFilters, Map grokPatterns) { - super(NAME, transportService, actionFilters, Request::new); + TransportAction(TransportService transportService, ActionFilters actionFilters, Map grokPatterns, Tracer tracer) { + super(NAME, transportService, actionFilters, Request::new, tracer); this.grokPatterns = grokPatterns; this.sortedGrokPatterns = new TreeMap<>(this.grokPatterns); } diff --git a/modules/ingest-common/src/test/java/org/opensearch/ingest/common/GrokProcessorGetActionTests.java b/modules/ingest-common/src/test/java/org/opensearch/ingest/common/GrokProcessorGetActionTests.java index f8c760d48920f..3467c4257e25b 100644 --- a/modules/ingest-common/src/test/java/org/opensearch/ingest/common/GrokProcessorGetActionTests.java +++ b/modules/ingest-common/src/test/java/org/opensearch/ingest/common/GrokProcessorGetActionTests.java @@ -41,6 +41,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; +import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.transport.TransportService; @@ -84,7 +85,8 @@ public void testResponseSorting() { GrokProcessorGetAction.TransportAction transportAction = new GrokProcessorGetAction.TransportAction( mock(TransportService.class), mock(ActionFilters.class), - TEST_PATTERNS + TEST_PATTERNS, + NoopTracer.INSTANCE ); GrokProcessorGetAction.Response[] receivedResponse = new GrokProcessorGetAction.Response[1]; transportAction.doExecute(null, new GrokProcessorGetAction.Request(true), new ActionListener() { diff --git a/modules/lang-mustache/src/main/java/org/opensearch/script/mustache/TransportMultiSearchTemplateAction.java b/modules/lang-mustache/src/main/java/org/opensearch/script/mustache/TransportMultiSearchTemplateAction.java index b17b48ec1cbf8..e97b21c66a4f1 100644 --- a/modules/lang-mustache/src/main/java/org/opensearch/script/mustache/TransportMultiSearchTemplateAction.java +++ b/modules/lang-mustache/src/main/java/org/opensearch/script/mustache/TransportMultiSearchTemplateAction.java @@ -43,6 +43,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.script.ScriptService; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; import java.util.ArrayList; @@ -62,9 +63,10 @@ public TransportMultiSearchTemplateAction( ActionFilters actionFilters, ScriptService scriptService, NamedXContentRegistry xContentRegistry, - NodeClient client + NodeClient client, + Tracer tracer ) { - super(MultiSearchTemplateAction.NAME, transportService, actionFilters, MultiSearchTemplateRequest::new); + super(MultiSearchTemplateAction.NAME, transportService, actionFilters, MultiSearchTemplateRequest::new, tracer); this.scriptService = scriptService; this.xContentRegistry = xContentRegistry; this.client = client; diff --git a/modules/lang-mustache/src/main/java/org/opensearch/script/mustache/TransportSearchTemplateAction.java b/modules/lang-mustache/src/main/java/org/opensearch/script/mustache/TransportSearchTemplateAction.java index 6e8b9d059b583..adf1d32119ed6 100644 --- a/modules/lang-mustache/src/main/java/org/opensearch/script/mustache/TransportSearchTemplateAction.java +++ b/modules/lang-mustache/src/main/java/org/opensearch/script/mustache/TransportSearchTemplateAction.java @@ -52,6 +52,7 @@ import org.opensearch.search.builder.SearchSourceBuilder; import org.opensearch.search.internal.SearchContext; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; import java.io.IOException; @@ -71,9 +72,10 @@ public TransportSearchTemplateAction( ActionFilters actionFilters, ScriptService scriptService, NamedXContentRegistry xContentRegistry, - NodeClient client + NodeClient client, + Tracer tracer ) { - super(SearchTemplateAction.NAME, transportService, actionFilters, SearchTemplateRequest::new); + super(SearchTemplateAction.NAME, transportService, actionFilters, SearchTemplateRequest::new, tracer); this.scriptService = scriptService; this.xContentRegistry = xContentRegistry; this.client = client; diff --git a/modules/lang-painless/src/main/java/org/opensearch/painless/action/PainlessContextAction.java b/modules/lang-painless/src/main/java/org/opensearch/painless/action/PainlessContextAction.java index a26cb79a9717d..3098902d60c97 100644 --- a/modules/lang-painless/src/main/java/org/opensearch/painless/action/PainlessContextAction.java +++ b/modules/lang-painless/src/main/java/org/opensearch/painless/action/PainlessContextAction.java @@ -54,6 +54,7 @@ import org.opensearch.rest.action.RestToXContentListener; import org.opensearch.script.ScriptContext; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; import java.io.IOException; @@ -166,8 +167,13 @@ public static class TransportAction extends HandledTransportAction) Request::new); + public TransportAction( + TransportService transportService, + ActionFilters actionFilters, + PainlessScriptEngine painlessScriptEngine, + Tracer tracer + ) { + super(NAME, transportService, actionFilters, (Writeable.Reader) Request::new, tracer); this.painlessScriptEngine = painlessScriptEngine; } diff --git a/modules/lang-painless/src/main/java/org/opensearch/painless/action/PainlessExecuteAction.java b/modules/lang-painless/src/main/java/org/opensearch/painless/action/PainlessExecuteAction.java index 67b298eee7973..f7fcb3fe4add6 100644 --- a/modules/lang-painless/src/main/java/org/opensearch/painless/action/PainlessExecuteAction.java +++ b/modules/lang-painless/src/main/java/org/opensearch/painless/action/PainlessExecuteAction.java @@ -90,6 +90,7 @@ import org.opensearch.script.ScriptContext; import org.opensearch.script.ScriptService; import org.opensearch.script.ScriptType; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -475,7 +476,8 @@ public TransportAction( IndexNameExpressionResolver indexNameExpressionResolver, ScriptService scriptService, ClusterService clusterService, - IndicesService indicesServices + IndicesService indicesServices, + Tracer tracer ) { super( NAME, @@ -488,7 +490,8 @@ public TransportAction( // Creating a in-memory index is not light weight // TODO: is MANAGEMENT TP the right TP? Right now this is an admin api (see action name). Request::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); this.scriptService = scriptService; this.indicesServices = indicesServices; diff --git a/modules/rank-eval/src/main/java/org/opensearch/index/rankeval/TransportRankEvalAction.java b/modules/rank-eval/src/main/java/org/opensearch/index/rankeval/TransportRankEvalAction.java index ffdea14e0873d..923ba571850f1 100644 --- a/modules/rank-eval/src/main/java/org/opensearch/index/rankeval/TransportRankEvalAction.java +++ b/modules/rank-eval/src/main/java/org/opensearch/index/rankeval/TransportRankEvalAction.java @@ -53,6 +53,7 @@ import org.opensearch.search.SearchHit; import org.opensearch.search.builder.SearchSourceBuilder; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; import java.io.IOException; @@ -90,9 +91,10 @@ public TransportRankEvalAction( Client client, TransportService transportService, ScriptService scriptService, - NamedXContentRegistry namedXContentRegistry + NamedXContentRegistry namedXContentRegistry, + Tracer tracer ) { - super(RankEvalAction.NAME, transportService, actionFilters, (Writeable.Reader) RankEvalRequest::new); + super(RankEvalAction.NAME, transportService, actionFilters, (Writeable.Reader) RankEvalRequest::new, tracer); this.scriptService = scriptService; this.namedXContentRegistry = namedXContentRegistry; this.client = client; diff --git a/modules/rank-eval/src/test/java/org/opensearch/index/rankeval/TransportRankEvalActionTests.java b/modules/rank-eval/src/test/java/org/opensearch/index/rankeval/TransportRankEvalActionTests.java index bd42289015bf4..650d49f0059fa 100644 --- a/modules/rank-eval/src/test/java/org/opensearch/index/rankeval/TransportRankEvalActionTests.java +++ b/modules/rank-eval/src/test/java/org/opensearch/index/rankeval/TransportRankEvalActionTests.java @@ -44,6 +44,7 @@ import org.opensearch.env.Environment; import org.opensearch.script.ScriptService; import org.opensearch.search.builder.SearchSourceBuilder; +import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.transport.TransportService; @@ -103,7 +104,8 @@ public void multiSearch(MultiSearchRequest request, ActionListener) DeleteByQueryRequest::new + (Writeable.Reader) DeleteByQueryRequest::new, + tracer ); this.threadPool = threadPool; this.client = client; diff --git a/modules/reindex/src/main/java/org/opensearch/index/reindex/TransportReindexAction.java b/modules/reindex/src/main/java/org/opensearch/index/reindex/TransportReindexAction.java index e624b0619a26e..d9da6aaee3081 100644 --- a/modules/reindex/src/main/java/org/opensearch/index/reindex/TransportReindexAction.java +++ b/modules/reindex/src/main/java/org/opensearch/index/reindex/TransportReindexAction.java @@ -46,6 +46,7 @@ import org.opensearch.index.reindex.spi.RemoteReindexExtension; import org.opensearch.script.ScriptService; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -87,9 +88,10 @@ public TransportReindexAction( AutoCreateIndex autoCreateIndex, Client client, TransportService transportService, - ReindexSslConfig sslConfig + ReindexSslConfig sslConfig, + Tracer tracer ) { - super(ReindexAction.NAME, transportService, actionFilters, ReindexRequest::new); + super(ReindexAction.NAME, transportService, actionFilters, ReindexRequest::new, tracer); this.reindexValidator = new ReindexValidator(settings, clusterService, indexNameExpressionResolver, autoCreateIndex); this.reindexer = new Reindexer(clusterService, client, threadPool, scriptService, sslConfig, remoteExtension); } diff --git a/modules/reindex/src/main/java/org/opensearch/index/reindex/TransportRethrottleAction.java b/modules/reindex/src/main/java/org/opensearch/index/reindex/TransportRethrottleAction.java index 21ae8fd722629..b4755e9570541 100644 --- a/modules/reindex/src/main/java/org/opensearch/index/reindex/TransportRethrottleAction.java +++ b/modules/reindex/src/main/java/org/opensearch/index/reindex/TransportRethrottleAction.java @@ -44,6 +44,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.tasks.TaskId; import org.opensearch.tasks.TaskInfo; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -57,7 +58,8 @@ public TransportRethrottleAction( ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, - Client client + Client client, + Tracer tracer ) { super( RethrottleAction.NAME, @@ -67,7 +69,8 @@ public TransportRethrottleAction( RethrottleRequest::new, ListTasksResponse::new, TaskInfo::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); this.client = client; } diff --git a/modules/reindex/src/main/java/org/opensearch/index/reindex/TransportUpdateByQueryAction.java b/modules/reindex/src/main/java/org/opensearch/index/reindex/TransportUpdateByQueryAction.java index 1af9b62d72fd4..97c7c1dbbdaa8 100644 --- a/modules/reindex/src/main/java/org/opensearch/index/reindex/TransportUpdateByQueryAction.java +++ b/modules/reindex/src/main/java/org/opensearch/index/reindex/TransportUpdateByQueryAction.java @@ -49,6 +49,7 @@ import org.opensearch.script.Script; import org.opensearch.script.ScriptService; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -69,13 +70,15 @@ public TransportUpdateByQueryAction( Client client, TransportService transportService, ScriptService scriptService, - ClusterService clusterService + ClusterService clusterService, + Tracer tracer ) { super( UpdateByQueryAction.NAME, transportService, actionFilters, - (Writeable.Reader) UpdateByQueryRequest::new + (Writeable.Reader) UpdateByQueryRequest::new, + tracer ); this.threadPool = threadPool; this.client = client; diff --git a/modules/reindex/src/test/java/org/opensearch/index/reindex/AsyncBulkByScrollActionTests.java b/modules/reindex/src/test/java/org/opensearch/index/reindex/AsyncBulkByScrollActionTests.java index 8ddc1ff778982..87e06a7582e53 100644 --- a/modules/reindex/src/test/java/org/opensearch/index/reindex/AsyncBulkByScrollActionTests.java +++ b/modules/reindex/src/test/java/org/opensearch/index/reindex/AsyncBulkByScrollActionTests.java @@ -89,6 +89,7 @@ import org.opensearch.search.internal.InternalSearchResponse; import org.opensearch.tasks.Task; import org.opensearch.tasks.TaskManager; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.client.NoOpClient; import org.opensearch.threadpool.TestThreadPool; @@ -818,8 +819,13 @@ private static class DummyTransportAsyncBulkByScrollAction extends TransportActi DummyAbstractBulkByScrollRequest, BulkByScrollResponse> { - protected DummyTransportAsyncBulkByScrollAction(String actionName, ActionFilters actionFilters, TaskManager taskManager) { - super(actionName, actionFilters, taskManager); + protected DummyTransportAsyncBulkByScrollAction( + String actionName, + ActionFilters actionFilters, + TaskManager taskManager, + Tracer tracer + ) { + super(actionName, actionFilters, taskManager, tracer); } @Override diff --git a/modules/reindex/src/test/java/org/opensearch/index/reindex/UpdateByQueryWithScriptTests.java b/modules/reindex/src/test/java/org/opensearch/index/reindex/UpdateByQueryWithScriptTests.java index ce982dcb6bd34..d5b8a548d24f6 100644 --- a/modules/reindex/src/test/java/org/opensearch/index/reindex/UpdateByQueryWithScriptTests.java +++ b/modules/reindex/src/test/java/org/opensearch/index/reindex/UpdateByQueryWithScriptTests.java @@ -35,6 +35,7 @@ import org.opensearch.action.support.ActionFilters; import org.opensearch.cluster.ClusterState; import org.opensearch.script.ScriptService; +import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.transport.TransportService; import java.util.Collections; @@ -79,7 +80,8 @@ protected TransportUpdateByQueryAction.AsyncIndexBySearchAction action(ScriptSer null, transportService, scriptService, - null + null, + NoopTracer.INSTANCE ); return new TransportUpdateByQueryAction.AsyncIndexBySearchAction( task, diff --git a/plugins/events-correlation-engine/src/main/java/org/opensearch/plugin/correlation/rules/transport/TransportIndexCorrelationRuleAction.java b/plugins/events-correlation-engine/src/main/java/org/opensearch/plugin/correlation/rules/transport/TransportIndexCorrelationRuleAction.java index 7b4fb670c4aee..3761faa1a7468 100644 --- a/plugins/events-correlation-engine/src/main/java/org/opensearch/plugin/correlation/rules/transport/TransportIndexCorrelationRuleAction.java +++ b/plugins/events-correlation-engine/src/main/java/org/opensearch/plugin/correlation/rules/transport/TransportIndexCorrelationRuleAction.java @@ -34,6 +34,7 @@ import org.opensearch.plugin.correlation.utils.IndexUtils; import org.opensearch.rest.RestRequest; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; import java.io.IOException; @@ -68,9 +69,10 @@ public TransportIndexCorrelationRuleAction( Client client, ActionFilters actionFilters, ClusterService clusterService, - CorrelationRuleIndices correlationRuleIndices + CorrelationRuleIndices correlationRuleIndices, + Tracer tracer ) { - super(IndexCorrelationRuleAction.NAME, transportService, actionFilters, IndexCorrelationRuleRequest::new); + super(IndexCorrelationRuleAction.NAME, transportService, actionFilters, IndexCorrelationRuleRequest::new, tracer); this.client = client; this.clusterService = clusterService; this.correlationRuleIndices = correlationRuleIndices; diff --git a/plugins/telemetry-otel/src/internalClusterTest/java/org/opensearch/telemetry/tracing/TelemetryTracerEnabledSanityIT.java b/plugins/telemetry-otel/src/internalClusterTest/java/org/opensearch/telemetry/tracing/TelemetryTracerEnabledSanityIT.java index 8a49a0abf5512..b4e0d1048a48f 100644 --- a/plugins/telemetry-otel/src/internalClusterTest/java/org/opensearch/telemetry/tracing/TelemetryTracerEnabledSanityIT.java +++ b/plugins/telemetry-otel/src/internalClusterTest/java/org/opensearch/telemetry/tracing/TelemetryTracerEnabledSanityIT.java @@ -82,14 +82,14 @@ public void testSanityChecksWhenTracingEnabled() throws Exception { Arrays.asList( new AllSpansAreEndedProperly(), new AllSpansHaveUniqueId(), - new NumberOfTraceIDsEqualToRequests(Attributes.create().addAttribute("action", "indices:data/read/search[phase/query]")), + new NumberOfTraceIDsEqualToRequests(Attributes.create().addAttribute("action", "indices:data/read/search")), new TotalRootSpansEqualToRequests() ) ); InMemorySingletonSpanExporter exporter = InMemorySingletonSpanExporter.INSTANCE; if (!exporter.getFinishedSpanItems().isEmpty()) { - validators.validate(exporter.getFinishedSpanItems(), 6); + validators.validate(exporter.getFinishedSpanItems(), 2); } } diff --git a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/node/tasks/CancellableTasksIT.java b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/node/tasks/CancellableTasksIT.java index c4dcedcc722cf..7e39554c2453b 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/node/tasks/CancellableTasksIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/node/tasks/CancellableTasksIT.java @@ -68,6 +68,7 @@ import org.opensearch.tasks.Task; import org.opensearch.tasks.TaskInfo; import org.opensearch.tasks.TaskManager; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.test.InternalTestCluster; import org.opensearch.test.ParameterizedOpenSearchIntegTestCase; import org.opensearch.threadpool.ThreadPool; @@ -495,8 +496,8 @@ public static class TransportTestAction extends HandledTransportAction starting three cluster-manager nodes and two data nodes"); internalCluster().startClusterManagerOnlyNodes(3); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/TransportClusterAllocationExplainAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/TransportClusterAllocationExplainAction.java index d59c7e50c55cc..f5e9e4eaa31ba 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/TransportClusterAllocationExplainAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/TransportClusterAllocationExplainAction.java @@ -55,6 +55,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.snapshots.SnapshotsInfoService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -88,7 +89,8 @@ public TransportClusterAllocationExplainAction( ClusterInfoService clusterInfoService, SnapshotsInfoService snapshotsInfoService, AllocationDeciders allocationDeciders, - AllocationService allocationService + AllocationService allocationService, + Tracer tracer ) { super( ClusterAllocationExplainAction.NAME, @@ -97,7 +99,8 @@ public TransportClusterAllocationExplainAction( threadPool, actionFilters, ClusterAllocationExplainRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.clusterInfoService = clusterInfoService; this.snapshotsInfoService = snapshotsInfoService; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsAction.java index f578925e54ce7..1978c80bbeddb 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsAction.java @@ -55,6 +55,7 @@ import org.opensearch.common.unit.TimeValue; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.threadpool.ThreadPool.Names; import org.opensearch.transport.TransportService; @@ -96,7 +97,8 @@ public TransportAddVotingConfigExclusionsAction( ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( AddVotingConfigExclusionsAction.NAME, @@ -105,7 +107,8 @@ public TransportAddVotingConfigExclusionsAction( threadPool, actionFilters, AddVotingConfigExclusionsRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); maxVotingConfigExclusions = MAXIMUM_VOTING_CONFIG_EXCLUSIONS_SETTING.get(settings); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsAction.java index c3c08b9636518..fcd5c99a35a48 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsAction.java @@ -51,6 +51,7 @@ import org.opensearch.common.unit.TimeValue; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.threadpool.ThreadPool.Names; import org.opensearch.transport.TransportService; @@ -77,7 +78,8 @@ public TransportClearVotingConfigExclusionsAction( ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( ClearVotingConfigExclusionsAction.NAME, @@ -86,7 +88,8 @@ public TransportClearVotingConfigExclusionsAction( threadPool, actionFilters, ClearVotingConfigExclusionsRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/decommission/awareness/delete/TransportDeleteDecommissionStateAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/decommission/awareness/delete/TransportDeleteDecommissionStateAction.java index 8901375a4095a..212a77d0def07 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/decommission/awareness/delete/TransportDeleteDecommissionStateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/decommission/awareness/delete/TransportDeleteDecommissionStateAction.java @@ -21,6 +21,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -45,7 +46,8 @@ public TransportDeleteDecommissionStateAction( ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - DecommissionService decommissionService + DecommissionService decommissionService, + Tracer tracer ) { super( DeleteDecommissionStateAction.NAME, @@ -54,7 +56,8 @@ public TransportDeleteDecommissionStateAction( threadPool, actionFilters, DeleteDecommissionStateRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.decommissionService = decommissionService; } diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/decommission/awareness/get/TransportGetDecommissionStateAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/decommission/awareness/get/TransportGetDecommissionStateAction.java index 22feb4d99297a..1ead4daef5a29 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/decommission/awareness/get/TransportGetDecommissionStateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/decommission/awareness/get/TransportGetDecommissionStateAction.java @@ -19,6 +19,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -39,7 +40,8 @@ public TransportGetDecommissionStateAction( ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( GetDecommissionStateAction.NAME, @@ -48,7 +50,8 @@ public TransportGetDecommissionStateAction( threadPool, actionFilters, GetDecommissionStateRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/decommission/awareness/put/TransportDecommissionAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/decommission/awareness/put/TransportDecommissionAction.java index 0b1fd380ffdda..4a18427680704 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/decommission/awareness/put/TransportDecommissionAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/decommission/awareness/put/TransportDecommissionAction.java @@ -21,6 +21,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -43,7 +44,8 @@ public TransportDecommissionAction( DecommissionService decommissionService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( DecommissionAction.NAME, @@ -52,7 +54,8 @@ public TransportDecommissionAction( threadPool, actionFilters, DecommissionRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.decommissionService = decommissionService; } diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/health/TransportClusterHealthAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/health/TransportClusterHealthAction.java index 1cc357a4c20f4..806578391ddf5 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/health/TransportClusterHealthAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/health/TransportClusterHealthAction.java @@ -67,6 +67,7 @@ import org.opensearch.index.IndexNotFoundException; import org.opensearch.node.NodeClosedException; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -94,7 +95,8 @@ public TransportClusterHealthAction( ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, AllocationService allocationService, - Discovery discovery + Discovery discovery, + Tracer tracer ) { super( ClusterHealthAction.NAME, @@ -104,7 +106,8 @@ public TransportClusterHealthAction( threadPool, actionFilters, ClusterHealthRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.allocationService = allocationService; this.discovery = discovery; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/TransportNodesHotThreadsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/TransportNodesHotThreadsAction.java index 482d9526fa53c..6949f6409866a 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/TransportNodesHotThreadsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/TransportNodesHotThreadsAction.java @@ -41,6 +41,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.monitor.jvm.HotThreads; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportRequest; import org.opensearch.transport.TransportService; @@ -64,7 +65,8 @@ public TransportNodesHotThreadsAction( ThreadPool threadPool, ClusterService clusterService, TransportService transportService, - ActionFilters actionFilters + ActionFilters actionFilters, + Tracer tracer ) { super( NodesHotThreadsAction.NAME, @@ -75,7 +77,8 @@ public TransportNodesHotThreadsAction( NodesHotThreadsRequest::new, NodeRequest::new, ThreadPool.Names.GENERIC, - NodeHotThreads.class + NodeHotThreads.class, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/TransportNodesInfoAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/TransportNodesInfoAction.java index 2c4f8522a5a5c..a5f6b0853a449 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/TransportNodesInfoAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/TransportNodesInfoAction.java @@ -40,6 +40,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.node.NodeService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportRequest; import org.opensearch.transport.TransportService; @@ -67,7 +68,8 @@ public TransportNodesInfoAction( ClusterService clusterService, TransportService transportService, NodeService nodeService, - ActionFilters actionFilters + ActionFilters actionFilters, + Tracer tracer ) { super( NodesInfoAction.NAME, @@ -78,7 +80,8 @@ public TransportNodesInfoAction( NodesInfoRequest::new, NodeInfoRequest::new, ThreadPool.Names.MANAGEMENT, - NodeInfo.class + NodeInfo.class, + tracer ); this.nodeService = nodeService; } diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/TransportNodesReloadSecureSettingsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/TransportNodesReloadSecureSettingsAction.java index 92b8af0b8aa84..8fb4f0fdd2392 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/TransportNodesReloadSecureSettingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/TransportNodesReloadSecureSettingsAction.java @@ -52,6 +52,7 @@ import org.opensearch.plugins.PluginsService; import org.opensearch.plugins.ReloadablePlugin; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportRequest; import org.opensearch.transport.TransportService; @@ -81,7 +82,8 @@ public TransportNodesReloadSecureSettingsAction( TransportService transportService, ActionFilters actionFilters, Environment environment, - PluginsService pluginService + PluginsService pluginService, + Tracer tracer ) { super( NodesReloadSecureSettingsAction.NAME, @@ -92,7 +94,8 @@ public TransportNodesReloadSecureSettingsAction( NodesReloadSecureSettingsRequest::new, NodeRequest::new, ThreadPool.Names.GENERIC, - NodesReloadSecureSettingsResponse.NodeResponse.class + NodesReloadSecureSettingsResponse.NodeResponse.class, + tracer ); this.environment = environment; this.pluginsService = pluginService; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java index 615abbaef845d..b317ddccadfb5 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java @@ -40,6 +40,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.node.NodeService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportRequest; import org.opensearch.transport.TransportService; @@ -67,7 +68,8 @@ public TransportNodesStatsAction( ClusterService clusterService, TransportService transportService, NodeService nodeService, - ActionFilters actionFilters + ActionFilters actionFilters, + Tracer tracer ) { super( NodesStatsAction.NAME, @@ -78,7 +80,8 @@ public TransportNodesStatsAction( NodesStatsRequest::new, NodeStatsRequest::new, ThreadPool.Names.MANAGEMENT, - NodeStats.class + NodeStats.class, + tracer ); this.nodeService = nodeService; } diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/TransportCancelTasksAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/TransportCancelTasksAction.java index 634ce1e2d4095..5291e9130bd16 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/TransportCancelTasksAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/TransportCancelTasksAction.java @@ -42,6 +42,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.tasks.CancellableTask; import org.opensearch.tasks.TaskInfo; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportRequest; import org.opensearch.transport.TransportService; @@ -60,7 +61,12 @@ public class TransportCancelTasksAction extends TransportTasksAction { @Inject - public TransportCancelTasksAction(ClusterService clusterService, TransportService transportService, ActionFilters actionFilters) { + public TransportCancelTasksAction( + ClusterService clusterService, + TransportService transportService, + ActionFilters actionFilters, + Tracer tracer + ) { super( CancelTasksAction.NAME, clusterService, @@ -69,7 +75,8 @@ public TransportCancelTasksAction(ClusterService clusterService, TransportServic CancelTasksRequest::new, CancelTasksResponse::new, TaskInfo::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/TransportGetTaskAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/TransportGetTaskAction.java index 8d82827f4ee50..a2274b7ec1b00 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/TransportGetTaskAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/TransportGetTaskAction.java @@ -57,6 +57,7 @@ import org.opensearch.tasks.TaskInfo; import org.opensearch.tasks.TaskResult; import org.opensearch.tasks.TaskResultsService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportRequestOptions; import org.opensearch.transport.TransportService; @@ -91,9 +92,10 @@ public TransportGetTaskAction( ActionFilters actionFilters, ClusterService clusterService, Client client, - NamedXContentRegistry xContentRegistry + NamedXContentRegistry xContentRegistry, + Tracer tracer ) { - super(GetTaskAction.NAME, transportService, actionFilters, GetTaskRequest::new); + super(GetTaskAction.NAME, transportService, actionFilters, GetTaskRequest::new, tracer); this.threadPool = threadPool; this.clusterService = clusterService; this.transportService = transportService; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/TransportListTasksAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/TransportListTasksAction.java index 1c543e60c46e0..26d3d21b4f1a3 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/TransportListTasksAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/TransportListTasksAction.java @@ -43,6 +43,7 @@ import org.opensearch.tasks.Task; import org.opensearch.tasks.TaskInfo; import org.opensearch.tasks.TaskResourceTrackingService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -73,7 +74,8 @@ public TransportListTasksAction( ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, - TaskResourceTrackingService taskResourceTrackingService + TaskResourceTrackingService taskResourceTrackingService, + Tracer tracer ) { super( ListTasksAction.NAME, @@ -83,7 +85,8 @@ public TransportListTasksAction( ListTasksRequest::new, ListTasksResponse::new, TaskInfo::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); this.taskResourceTrackingService = taskResourceTrackingService; } diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/TransportNodesUsageAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/TransportNodesUsageAction.java index 7a4aeff50c6e7..d13e2a9838cb2 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/TransportNodesUsageAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/TransportNodesUsageAction.java @@ -40,6 +40,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.search.aggregations.support.AggregationUsageService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportRequest; import org.opensearch.transport.TransportService; @@ -71,7 +72,8 @@ public TransportNodesUsageAction( TransportService transportService, ActionFilters actionFilters, UsageService restUsageService, - AggregationUsageService aggregationUsageService + AggregationUsageService aggregationUsageService, + Tracer tracer ) { super( NodesUsageAction.NAME, @@ -82,7 +84,8 @@ public TransportNodesUsageAction( NodesUsageRequest::new, NodeUsageRequest::new, ThreadPool.Names.MANAGEMENT, - NodeUsage.class + NodeUsage.class, + tracer ); this.restUsageService = restUsageService; this.aggregationUsageService = aggregationUsageService; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/remote/TransportRemoteInfoAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/remote/TransportRemoteInfoAction.java index cb7c965069987..6974e24bc34c5 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/remote/TransportRemoteInfoAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/remote/TransportRemoteInfoAction.java @@ -38,6 +38,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.action.ActionListener; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.RemoteClusterService; import org.opensearch.transport.TransportService; @@ -56,9 +57,10 @@ public final class TransportRemoteInfoAction extends HandledTransportAction requestValidators + final RequestValidators requestValidators, + final Tracer tracer ) { super( IndicesAliasesAction.NAME, @@ -98,7 +100,8 @@ public TransportIndicesAliasesAction( threadPool, actionFilters, IndicesAliasesRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.indexAliasesService = indexAliasesService; this.requestValidators = Objects.requireNonNull(requestValidators); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/get/TransportGetAliasesAction.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/get/TransportGetAliasesAction.java index 3aca9c1976f16..3e48e3b2234b7 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/get/TransportGetAliasesAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/get/TransportGetAliasesAction.java @@ -46,6 +46,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.indices.SystemIndices; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -77,7 +78,8 @@ public TransportGetAliasesAction( ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - SystemIndices systemIndices + SystemIndices systemIndices, + Tracer tracer ) { super( GetAliasesAction.NAME, @@ -86,7 +88,8 @@ public TransportGetAliasesAction( threadPool, actionFilters, GetAliasesRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.systemIndices = systemIndices; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/analyze/TransportAnalyzeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/analyze/TransportAnalyzeAction.java index 8dc55e580b9ec..0bfeabe2f4a03 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/analyze/TransportAnalyzeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/analyze/TransportAnalyzeAction.java @@ -66,6 +66,7 @@ import org.opensearch.index.mapper.MappedFieldType; import org.opensearch.index.mapper.StringFieldType; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -98,7 +99,8 @@ public TransportAnalyzeAction( TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( AnalyzeAction.NAME, @@ -108,7 +110,8 @@ public TransportAnalyzeAction( actionFilters, indexNameExpressionResolver, AnalyzeAction.Request::new, - ThreadPool.Names.ANALYZE + ThreadPool.Names.ANALYZE, + tracer ); this.settings = settings; this.indicesService = indicesService; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java b/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java index acc6a6c14c5fd..ed813602a3e4e 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java @@ -47,6 +47,7 @@ import org.opensearch.index.shard.ShardPath; import org.opensearch.indices.IndicesService; import org.opensearch.node.Node; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -76,7 +77,8 @@ public TransportClearIndicesCacheAction( IndicesService indicesService, Node node, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( ClearIndicesCacheAction.NAME, @@ -86,7 +88,8 @@ public TransportClearIndicesCacheAction( indexNameExpressionResolver, ClearIndicesCacheRequest::new, ThreadPool.Names.MANAGEMENT, - false + false, + tracer ); this.indicesService = indicesService; this.node = node; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/close/TransportCloseIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/close/TransportCloseIndexAction.java index cde2ef63df02d..b3d2d11d1aae4 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/close/TransportCloseIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/close/TransportCloseIndexAction.java @@ -53,6 +53,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.index.Index; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -88,7 +89,8 @@ public TransportCloseIndexAction( ClusterSettings clusterSettings, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - DestructiveOperations destructiveOperations + DestructiveOperations destructiveOperations, + Tracer tracer ) { super( CloseIndexAction.NAME, @@ -97,7 +99,8 @@ public TransportCloseIndexAction( threadPool, actionFilters, CloseIndexRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.indexStateService = indexStateService; this.destructiveOperations = destructiveOperations; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseAction.java b/server/src/main/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseAction.java index a8a512a5ad05a..62064dfec68b6 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseAction.java @@ -53,6 +53,7 @@ import org.opensearch.core.tasks.TaskId; import org.opensearch.index.shard.IndexShard; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -80,7 +81,8 @@ public TransportVerifyShardBeforeCloseAction( final IndicesService indicesService, final ThreadPool threadPool, final ShardStateAction stateAction, - final ActionFilters actionFilters + final ActionFilters actionFilters, + final Tracer tracer ) { super( settings, @@ -93,7 +95,8 @@ public TransportVerifyShardBeforeCloseAction( actionFilters, ShardRequest::new, ShardRequest::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/create/AutoCreateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/create/AutoCreateAction.java index 02dd2de803f58..aa64aaf6459ce 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/create/AutoCreateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/create/AutoCreateAction.java @@ -56,6 +56,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -96,9 +97,19 @@ public TransportAction( ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, MetadataCreateIndexService createIndexService, - MetadataCreateDataStreamService metadataCreateDataStreamService + MetadataCreateDataStreamService metadataCreateDataStreamService, + Tracer tracer ) { - super(NAME, transportService, clusterService, threadPool, actionFilters, CreateIndexRequest::new, indexNameExpressionResolver); + super( + NAME, + transportService, + clusterService, + threadPool, + actionFilters, + CreateIndexRequest::new, + indexNameExpressionResolver, + tracer + ); this.activeShardsObserver = new ActiveShardsObserver(clusterService, threadPool); this.createIndexService = createIndexService; this.metadataCreateDataStreamService = metadataCreateDataStreamService; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/create/TransportCreateIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/create/TransportCreateIndexAction.java index b5f822bd45b7e..8c48429cc4631 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/create/TransportCreateIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/create/TransportCreateIndexAction.java @@ -43,6 +43,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -64,7 +65,8 @@ public TransportCreateIndexAction( ThreadPool threadPool, MetadataCreateIndexService createIndexService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( CreateIndexAction.NAME, @@ -73,7 +75,8 @@ public TransportCreateIndexAction( threadPool, actionFilters, CreateIndexRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.createIndexService = createIndexService; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/TransportDeleteDanglingIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/TransportDeleteDanglingIndexAction.java index 751a872ee7dcd..467796bbc1632 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/TransportDeleteDanglingIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/TransportDeleteDanglingIndexAction.java @@ -60,6 +60,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.index.Index; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -91,7 +92,8 @@ public TransportDeleteDanglingIndexAction( ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, Settings settings, - NodeClient nodeClient + NodeClient nodeClient, + Tracer tracer ) { super( DeleteDanglingIndexAction.NAME, @@ -100,7 +102,8 @@ public TransportDeleteDanglingIndexAction( threadPool, actionFilters, DeleteDanglingIndexRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.settings = settings; this.nodeClient = nodeClient; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/TransportFindDanglingIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/TransportFindDanglingIndexAction.java index 13da03a04acbd..e772647cdb2fc 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/TransportFindDanglingIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/TransportFindDanglingIndexAction.java @@ -41,6 +41,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.gateway.DanglingIndicesState; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -68,7 +69,8 @@ public TransportFindDanglingIndexAction( ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, - DanglingIndicesState danglingIndicesState + DanglingIndicesState danglingIndicesState, + Tracer tracer ) { super( FindDanglingIndexAction.NAME, @@ -79,7 +81,8 @@ public TransportFindDanglingIndexAction( FindDanglingIndexRequest::new, NodeFindDanglingIndexRequest::new, ThreadPool.Names.MANAGEMENT, - NodeFindDanglingIndexResponse.class + NodeFindDanglingIndexResponse.class, + tracer ); this.transportService = transportService; this.danglingIndicesState = danglingIndicesState; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/TransportImportDanglingIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/TransportImportDanglingIndexAction.java index 3f47d1bf083f4..62ea06a7e16a2 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/TransportImportDanglingIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/TransportImportDanglingIndexAction.java @@ -49,6 +49,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.gateway.LocalAllocateDangledIndices; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; import java.util.ArrayList; @@ -76,9 +77,10 @@ public TransportImportDanglingIndexAction( ActionFilters actionFilters, TransportService transportService, LocalAllocateDangledIndices danglingIndexAllocator, - NodeClient nodeClient + NodeClient nodeClient, + Tracer tracer ) { - super(ImportDanglingIndexAction.NAME, transportService, actionFilters, ImportDanglingIndexRequest::new); + super(ImportDanglingIndexAction.NAME, transportService, actionFilters, ImportDanglingIndexRequest::new, tracer); this.danglingIndexAllocator = danglingIndexAllocator; this.nodeClient = nodeClient; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/TransportListDanglingIndicesAction.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/TransportListDanglingIndicesAction.java index 59076cc6ef8fb..f3b0120889387 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/TransportListDanglingIndicesAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/TransportListDanglingIndicesAction.java @@ -42,6 +42,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.gateway.DanglingIndicesState; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -69,7 +70,8 @@ public TransportListDanglingIndicesAction( ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, - DanglingIndicesState danglingIndicesState + DanglingIndicesState danglingIndicesState, + Tracer tracer ) { super( ListDanglingIndicesAction.NAME, @@ -80,7 +82,8 @@ public TransportListDanglingIndicesAction( ListDanglingIndicesRequest::new, NodeListDanglingIndicesRequest::new, ThreadPool.Names.MANAGEMENT, - NodeListDanglingIndicesResponse.class + NodeListDanglingIndicesResponse.class, + tracer ); this.transportService = transportService; this.danglingIndicesState = danglingIndicesState; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/datastream/CreateDataStreamAction.java b/server/src/main/java/org/opensearch/action/admin/indices/datastream/CreateDataStreamAction.java index 14b29c4b2bbba..21e974487ddb9 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/datastream/CreateDataStreamAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/datastream/CreateDataStreamAction.java @@ -52,6 +52,7 @@ import org.opensearch.core.common.Strings; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -145,9 +146,10 @@ public TransportAction( ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - MetadataCreateDataStreamService metadataCreateDataStreamService + MetadataCreateDataStreamService metadataCreateDataStreamService, + Tracer tracer ) { - super(NAME, transportService, clusterService, threadPool, actionFilters, Request::new, indexNameExpressionResolver); + super(NAME, transportService, clusterService, threadPool, actionFilters, Request::new, indexNameExpressionResolver, tracer); this.metadataCreateDataStreamService = metadataCreateDataStreamService; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/datastream/DataStreamsStatsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/datastream/DataStreamsStatsAction.java index fcb13f4091638..75594d5e0fbd3 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/datastream/DataStreamsStatsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/datastream/DataStreamsStatsAction.java @@ -64,6 +64,7 @@ import org.opensearch.index.shard.ShardNotFoundException; import org.opensearch.index.store.StoreStats; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -379,7 +380,8 @@ public TransportAction( TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( DataStreamsStatsAction.NAME, @@ -388,7 +390,8 @@ public TransportAction( actionFilters, indexNameExpressionResolver, Request::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); this.clusterService = clusterService; this.indicesService = indicesService; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/datastream/DeleteDataStreamAction.java b/server/src/main/java/org/opensearch/action/admin/indices/datastream/DeleteDataStreamAction.java index 190194e071bc4..275af1069c9b3 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/datastream/DeleteDataStreamAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/datastream/DeleteDataStreamAction.java @@ -64,6 +64,7 @@ import org.opensearch.core.index.Index; import org.opensearch.snapshots.SnapshotInProgressException; import org.opensearch.snapshots.SnapshotsService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -178,9 +179,10 @@ public TransportAction( ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - MetadataDeleteIndexService deleteIndexService + MetadataDeleteIndexService deleteIndexService, + Tracer tracer ) { - super(NAME, transportService, clusterService, threadPool, actionFilters, Request::new, indexNameExpressionResolver); + super(NAME, transportService, clusterService, threadPool, actionFilters, Request::new, indexNameExpressionResolver, tracer); this.deleteIndexService = deleteIndexService; // Task is onboarded for throttling, it will get retried from associated TransportClusterManagerNodeAction. removeDataStreamTaskKey = clusterService.registerClusterManagerTask(ClusterManagerTaskKeys.REMOVE_DATA_STREAM_KEY, true); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/datastream/GetDataStreamAction.java b/server/src/main/java/org/opensearch/action/admin/indices/datastream/GetDataStreamAction.java index 6a7967d31653c..6efb992445d23 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/datastream/GetDataStreamAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/datastream/GetDataStreamAction.java @@ -61,6 +61,7 @@ import org.opensearch.core.index.Index; import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -297,9 +298,10 @@ public TransportAction( ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { - super(NAME, transportService, clusterService, threadPool, actionFilters, Request::new, indexNameExpressionResolver); + super(NAME, transportService, clusterService, threadPool, actionFilters, Request::new, indexNameExpressionResolver, tracer); } @Override diff --git a/server/src/main/java/org/opensearch/action/admin/indices/delete/TransportDeleteIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/delete/TransportDeleteIndexAction.java index 410a58afc95f1..ffb423a744269 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/delete/TransportDeleteIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/delete/TransportDeleteIndexAction.java @@ -50,6 +50,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.index.Index; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -78,7 +79,8 @@ public TransportDeleteIndexAction( MetadataDeleteIndexService deleteIndexService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - DestructiveOperations destructiveOperations + DestructiveOperations destructiveOperations, + Tracer tracer ) { super( DeleteIndexAction.NAME, @@ -87,7 +89,8 @@ public TransportDeleteIndexAction( threadPool, actionFilters, DeleteIndexRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.deleteIndexService = deleteIndexService; this.destructiveOperations = destructiveOperations; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/TransportIndicesExistsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/TransportIndicesExistsAction.java index 428a0eb35513d..18f004d98335c 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/TransportIndicesExistsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/TransportIndicesExistsAction.java @@ -44,6 +44,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.index.IndexNotFoundException; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -62,7 +63,8 @@ public TransportIndicesExistsAction( ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( IndicesExistsAction.NAME, @@ -71,7 +73,8 @@ public TransportIndicesExistsAction( threadPool, actionFilters, IndicesExistsRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportFlushAction.java b/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportFlushAction.java index 07434c65862b6..88fb290a4e7d5 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportFlushAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportFlushAction.java @@ -40,6 +40,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.action.support.DefaultShardOperationFailedException; import org.opensearch.core.index.shard.ShardId; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; import java.util.List; @@ -61,7 +62,8 @@ public TransportFlushAction( TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - TransportShardFlushAction replicatedFlushAction + TransportShardFlushAction replicatedFlushAction, + Tracer tracer ) { super( FlushAction.NAME, @@ -70,7 +72,8 @@ public TransportFlushAction( transportService, actionFilters, indexNameExpressionResolver, - replicatedFlushAction + replicatedFlushAction, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportShardFlushAction.java b/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportShardFlushAction.java index 90db53af72257..ccb7144ab8e22 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportShardFlushAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportShardFlushAction.java @@ -47,6 +47,7 @@ import org.opensearch.index.shard.IndexShard; import org.opensearch.indices.IndicesService; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportChannel; import org.opensearch.transport.TransportRequest; @@ -72,7 +73,8 @@ public TransportShardFlushAction( IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, - ActionFilters actionFilters + ActionFilters actionFilters, + Tracer tracer ) { super( settings, @@ -85,7 +87,8 @@ public TransportShardFlushAction( actionFilters, ShardFlushRequest::new, ShardFlushRequest::new, - ThreadPool.Names.FLUSH + ThreadPool.Names.FLUSH, + tracer ); transportService.registerRequestHandler( PRE_SYNCED_FLUSH_ACTION_NAME, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/TransportForceMergeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/TransportForceMergeAction.java index fb8eb86c12269..c6e35f18eba1f 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/TransportForceMergeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/TransportForceMergeAction.java @@ -46,6 +46,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.index.shard.IndexShard; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -70,7 +71,8 @@ public TransportForceMergeAction( TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( ForceMergeAction.NAME, @@ -79,7 +81,8 @@ public TransportForceMergeAction( actionFilters, indexNameExpressionResolver, ForceMergeRequest::new, - ThreadPool.Names.FORCE_MERGE + ThreadPool.Names.FORCE_MERGE, + tracer ); this.indicesService = indicesService; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/get/TransportGetIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/get/TransportGetIndexAction.java index 755119401c6b5..e5d4b764979b7 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/get/TransportGetIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/get/TransportGetIndexAction.java @@ -47,6 +47,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -78,7 +79,8 @@ public TransportGetIndexAction( ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, IndicesService indicesService, - IndexScopedSettings indexScopedSettings + IndexScopedSettings indexScopedSettings, + Tracer tracer ) { super( GetIndexAction.NAME, @@ -87,7 +89,8 @@ public TransportGetIndexAction( threadPool, actionFilters, GetIndexRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.indicesService = indicesService; this.settingsFilter = settingsFilter; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetFieldMappingsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetFieldMappingsAction.java index 53dbb86233803..37d1ae11b2300 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetFieldMappingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetFieldMappingsAction.java @@ -40,6 +40,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.action.ActionListener; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; import java.util.HashMap; @@ -67,9 +68,10 @@ public TransportGetFieldMappingsAction( ClusterService clusterService, TransportGetFieldMappingsIndexAction shardAction, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { - super(GetFieldMappingsAction.NAME, transportService, actionFilters, GetFieldMappingsRequest::new); + super(GetFieldMappingsAction.NAME, transportService, actionFilters, GetFieldMappingsRequest::new, tracer); this.clusterService = clusterService; this.shardAction = shardAction; this.indexNameExpressionResolver = indexNameExpressionResolver; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetFieldMappingsIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetFieldMappingsIndexAction.java index 64f39644a4d96..7f494d7841d36 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetFieldMappingsIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetFieldMappingsIndexAction.java @@ -55,6 +55,7 @@ import org.opensearch.index.mapper.Mapper; import org.opensearch.index.mapper.MappingLookup; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -87,7 +88,8 @@ public TransportGetFieldMappingsIndexAction( IndicesService indicesService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( ACTION_NAME, @@ -97,7 +99,8 @@ public TransportGetFieldMappingsIndexAction( actionFilters, indexNameExpressionResolver, GetFieldMappingsIndexRequest::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); this.clusterService = clusterService; this.indicesService = indicesService; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetMappingsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetMappingsAction.java index 6f07aa4dbf48a..b6a3da6a2afaa 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetMappingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetMappingsAction.java @@ -44,6 +44,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -68,7 +69,8 @@ public TransportGetMappingsAction( ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - IndicesService indicesService + IndicesService indicesService, + Tracer tracer ) { super( GetMappingsAction.NAME, @@ -77,7 +79,8 @@ public TransportGetMappingsAction( threadPool, actionFilters, GetMappingsRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.indicesService = indicesService; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/TransportAutoPutMappingAction.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/TransportAutoPutMappingAction.java index 4722c1048014f..81fe4beda2aec 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/TransportAutoPutMappingAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/TransportAutoPutMappingAction.java @@ -45,6 +45,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.index.Index; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -66,7 +67,8 @@ public TransportAutoPutMappingAction( final ThreadPool threadPool, final MetadataMappingService metadataMappingService, final ActionFilters actionFilters, - final IndexNameExpressionResolver indexNameExpressionResolver + final IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( AutoPutMappingAction.NAME, @@ -75,7 +77,8 @@ public TransportAutoPutMappingAction( threadPool, actionFilters, PutMappingRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.metadataMappingService = metadataMappingService; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/TransportPutMappingAction.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/TransportPutMappingAction.java index ac797914aafd8..4cc065752bd5a 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/TransportPutMappingAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/TransportPutMappingAction.java @@ -51,6 +51,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.index.Index; import org.opensearch.index.IndexNotFoundException; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -81,7 +82,8 @@ public TransportPutMappingAction( final MetadataMappingService metadataMappingService, final ActionFilters actionFilters, final IndexNameExpressionResolver indexNameExpressionResolver, - final RequestValidators requestValidators + final RequestValidators requestValidators, + final Tracer tracer ) { super( PutMappingAction.NAME, @@ -90,7 +92,8 @@ public TransportPutMappingAction( threadPool, actionFilters, PutMappingRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.metadataMappingService = metadataMappingService; this.requestValidators = Objects.requireNonNull(requestValidators); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/open/TransportOpenIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/open/TransportOpenIndexAction.java index 0243990dce2ff..b224da4b27ac6 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/open/TransportOpenIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/open/TransportOpenIndexAction.java @@ -50,6 +50,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.index.Index; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -75,7 +76,8 @@ public TransportOpenIndexAction( MetadataIndexStateService indexStateService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - DestructiveOperations destructiveOperations + DestructiveOperations destructiveOperations, + Tracer tracer ) { super( OpenIndexAction.NAME, @@ -84,7 +86,8 @@ public TransportOpenIndexAction( threadPool, actionFilters, OpenIndexRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.indexStateService = indexStateService; this.destructiveOperations = destructiveOperations; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportAddIndexBlockAction.java b/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportAddIndexBlockAction.java index eb018d16119e0..b2bc94438ed64 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportAddIndexBlockAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportAddIndexBlockAction.java @@ -49,6 +49,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.index.Index; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -80,7 +81,8 @@ public TransportAddIndexBlockAction( MetadataIndexStateService indexStateService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - DestructiveOperations destructiveOperations + DestructiveOperations destructiveOperations, + Tracer tracer ) { super( AddIndexBlockAction.NAME, @@ -89,7 +91,8 @@ public TransportAddIndexBlockAction( threadPool, actionFilters, AddIndexBlockRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.indexStateService = indexStateService; this.destructiveOperations = destructiveOperations; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportVerifyShardIndexBlockAction.java b/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportVerifyShardIndexBlockAction.java index a86475a16a779..8625008a241ff 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportVerifyShardIndexBlockAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportVerifyShardIndexBlockAction.java @@ -53,6 +53,7 @@ import org.opensearch.core.tasks.TaskId; import org.opensearch.index.shard.IndexShard; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -84,7 +85,8 @@ public TransportVerifyShardIndexBlockAction( final IndicesService indicesService, final ThreadPool threadPool, final ShardStateAction stateAction, - final ActionFilters actionFilters + final ActionFilters actionFilters, + final Tracer tracer ) { super( settings, @@ -97,7 +99,8 @@ public TransportVerifyShardIndexBlockAction( actionFilters, ShardRequest::new, ShardRequest::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/recovery/TransportRecoveryAction.java b/server/src/main/java/org/opensearch/action/admin/indices/recovery/TransportRecoveryAction.java index de76ec2d4f5a7..b68259c42f0db 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/recovery/TransportRecoveryAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/recovery/TransportRecoveryAction.java @@ -48,6 +48,7 @@ import org.opensearch.index.shard.IndexShard; import org.opensearch.indices.IndicesService; import org.opensearch.indices.recovery.RecoveryState; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -73,7 +74,8 @@ public TransportRecoveryAction( TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( RecoveryAction.NAME, @@ -82,7 +84,8 @@ public TransportRecoveryAction( actionFilters, indexNameExpressionResolver, RecoveryRequest::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); this.indicesService = indicesService; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/refresh/TransportRefreshAction.java b/server/src/main/java/org/opensearch/action/admin/indices/refresh/TransportRefreshAction.java index e276cbf900ff0..1c0a597dbd2b7 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/refresh/TransportRefreshAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/refresh/TransportRefreshAction.java @@ -42,6 +42,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.action.support.DefaultShardOperationFailedException; import org.opensearch.core.index.shard.ShardId; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; import java.util.List; @@ -63,7 +64,8 @@ public TransportRefreshAction( TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - TransportShardRefreshAction shardRefreshAction + TransportShardRefreshAction shardRefreshAction, + Tracer tracer ) { super( RefreshAction.NAME, @@ -72,7 +74,8 @@ public TransportRefreshAction( transportService, actionFilters, indexNameExpressionResolver, - shardRefreshAction + shardRefreshAction, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/refresh/TransportShardRefreshAction.java b/server/src/main/java/org/opensearch/action/admin/indices/refresh/TransportShardRefreshAction.java index e17fa35395770..f331df1299188 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/refresh/TransportShardRefreshAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/refresh/TransportShardRefreshAction.java @@ -44,6 +44,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.index.shard.IndexShard; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -69,7 +70,8 @@ public TransportShardRefreshAction( IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, - ActionFilters actionFilters + ActionFilters actionFilters, + Tracer tracer ) { super( settings, @@ -82,7 +84,8 @@ public TransportShardRefreshAction( actionFilters, BasicReplicationRequest::new, BasicReplicationRequest::new, - ThreadPool.Names.REFRESH + ThreadPool.Names.REFRESH, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/replication/TransportSegmentReplicationStatsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/replication/TransportSegmentReplicationStatsAction.java index 1b912518d7e04..347ce0e10f4f1 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/replication/TransportSegmentReplicationStatsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/replication/TransportSegmentReplicationStatsAction.java @@ -29,6 +29,7 @@ import org.opensearch.indices.IndicesService; import org.opensearch.indices.replication.SegmentReplicationState; import org.opensearch.indices.replication.SegmentReplicationTargetService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -63,7 +64,8 @@ public TransportSegmentReplicationStatsAction( SegmentReplicationTargetService targetService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - SegmentReplicationPressureService pressureService + SegmentReplicationPressureService pressureService, + Tracer tracer ) { super( SegmentReplicationStatsAction.NAME, @@ -72,7 +74,8 @@ public TransportSegmentReplicationStatsAction( actionFilters, indexNameExpressionResolver, SegmentReplicationStatsRequest::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); this.indicesService = indicesService; this.targetService = targetService; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/resolve/ResolveIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/resolve/ResolveIndexAction.java index 98c2446e17998..dc81e7608fd6e 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/resolve/ResolveIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/resolve/ResolveIndexAction.java @@ -61,6 +61,7 @@ import org.opensearch.core.xcontent.ToXContentObject; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.RemoteClusterAware; import org.opensearch.transport.RemoteClusterService; @@ -504,9 +505,10 @@ public TransportAction( ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { - super(NAME, transportService, actionFilters, Request::new); + super(NAME, transportService, actionFilters, Request::new, tracer); this.threadPool = threadPool; this.clusterService = clusterService; this.remoteClusterService = transportService.getRemoteClusterService(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/rollover/TransportRolloverAction.java b/server/src/main/java/org/opensearch/action/admin/indices/rollover/TransportRolloverAction.java index 3b11a3d82d707..3e3f145e583d4 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/rollover/TransportRolloverAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/rollover/TransportRolloverAction.java @@ -58,6 +58,7 @@ import org.opensearch.core.common.unit.ByteSizeValue; import org.opensearch.index.shard.DocsStats; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -89,7 +90,8 @@ public TransportRolloverAction( ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, MetadataRolloverService rolloverService, - Client client + Client client, + Tracer tracer ) { super( RolloverAction.NAME, @@ -98,7 +100,8 @@ public TransportRolloverAction( threadPool, actionFilters, RolloverRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.rolloverService = rolloverService; this.client = client; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java index 6dad4b8e3554f..348402fd4bf71 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java @@ -47,6 +47,7 @@ import org.opensearch.index.IndexService; import org.opensearch.index.shard.IndexShard; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -71,7 +72,8 @@ public TransportIndicesSegmentsAction( TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( IndicesSegmentsAction.NAME, @@ -80,7 +82,8 @@ public TransportIndicesSegmentsAction( actionFilters, indexNameExpressionResolver, IndicesSegmentsRequest::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); this.indicesService = indicesService; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/segments/TransportPitSegmentsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/segments/TransportPitSegmentsAction.java index 393c07ba58c5e..0071e9e2667ef 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/segments/TransportPitSegmentsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/segments/TransportPitSegmentsAction.java @@ -38,6 +38,7 @@ import org.opensearch.search.SearchService; import org.opensearch.search.internal.PitReaderContext; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -72,7 +73,8 @@ public TransportPitSegmentsAction( IndexNameExpressionResolver indexNameExpressionResolver, SearchService searchService, NamedWriteableRegistry namedWriteableRegistry, - PitService pitService + PitService pitService, + Tracer tracer ) { super( PitSegmentsAction.NAME, @@ -81,7 +83,8 @@ public TransportPitSegmentsAction( actionFilters, indexNameExpressionResolver, PitSegmentsRequest::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); this.clusterService = clusterService; this.indicesService = indicesService; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/settings/get/TransportGetSettingsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/settings/get/TransportGetSettingsAction.java index d8f2180208b18..3335a0af008be 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/settings/get/TransportGetSettingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/settings/get/TransportGetSettingsAction.java @@ -49,6 +49,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.common.util.CollectionUtils; import org.opensearch.core.index.Index; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -74,7 +75,8 @@ public TransportGetSettingsAction( SettingsFilter settingsFilter, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - IndexScopedSettings indexedScopedSettings + IndexScopedSettings indexedScopedSettings, + Tracer tracer ) { super( GetSettingsAction.NAME, @@ -83,7 +85,8 @@ public TransportGetSettingsAction( threadPool, actionFilters, GetSettingsRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.settingsFilter = settingsFilter; this.indexScopedSettings = indexedScopedSettings; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/settings/put/TransportUpdateSettingsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/settings/put/TransportUpdateSettingsAction.java index 1c57dc27df8c6..d660a9ffaf882 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/settings/put/TransportUpdateSettingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/settings/put/TransportUpdateSettingsAction.java @@ -51,6 +51,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.index.Index; import org.opensearch.index.IndexModule; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -91,7 +92,8 @@ public TransportUpdateSettingsAction( ThreadPool threadPool, MetadataUpdateSettingsService updateSettingsService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( UpdateSettingsAction.NAME, @@ -100,7 +102,8 @@ public TransportUpdateSettingsAction( threadPool, actionFilters, UpdateSettingsRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.updateSettingsService = updateSettingsService; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shards/TransportIndicesShardStoresAction.java b/server/src/main/java/org/opensearch/action/admin/indices/shards/TransportIndicesShardStoresAction.java index 41225bc362235..a41ea4ae3c41d 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shards/TransportIndicesShardStoresAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shards/TransportIndicesShardStoresAction.java @@ -61,6 +61,7 @@ import org.opensearch.gateway.AsyncShardFetch; import org.opensearch.gateway.TransportNodesListGatewayStartedShards; import org.opensearch.gateway.TransportNodesListGatewayStartedShards.NodeGatewayStartedShards; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -96,7 +97,8 @@ public TransportIndicesShardStoresAction( ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - TransportNodesListGatewayStartedShards listShardStoresInfo + TransportNodesListGatewayStartedShards listShardStoresInfo, + Tracer tracer ) { super( IndicesShardStoresAction.NAME, @@ -105,7 +107,8 @@ public TransportIndicesShardStoresAction( threadPool, actionFilters, IndicesShardStoresRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.listShardStoresInfo = listShardStoresInfo; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java index 23cd8efdcaf59..74d5777aac760 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java @@ -57,6 +57,7 @@ import org.opensearch.index.IndexSettings; import org.opensearch.index.shard.DocsStats; import org.opensearch.index.store.StoreStats; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -85,7 +86,8 @@ public TransportResizeAction( MetadataCreateIndexService createIndexService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - Client client + Client client, + Tracer tracer ) { this( ResizeAction.NAME, @@ -95,7 +97,8 @@ public TransportResizeAction( createIndexService, actionFilters, indexNameExpressionResolver, - client + client, + tracer ); } @@ -107,9 +110,19 @@ protected TransportResizeAction( MetadataCreateIndexService createIndexService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - Client client + Client client, + Tracer tracer ) { - super(actionName, transportService, clusterService, threadPool, actionFilters, ResizeRequest::new, indexNameExpressionResolver); + super( + actionName, + transportService, + clusterService, + threadPool, + actionFilters, + ResizeRequest::new, + indexNameExpressionResolver, + tracer + ); this.createIndexService = createIndexService; this.client = client; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/TransportIndicesStatsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/TransportIndicesStatsAction.java index 2b85b6d5d6b5b..4af1731c9eaf1 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/TransportIndicesStatsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/TransportIndicesStatsAction.java @@ -52,6 +52,7 @@ import org.opensearch.index.shard.IndexShard; import org.opensearch.index.shard.ShardNotFoundException; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -73,7 +74,8 @@ public TransportIndicesStatsAction( TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( IndicesStatsAction.NAME, @@ -82,7 +84,8 @@ public TransportIndicesStatsAction( actionFilters, indexNameExpressionResolver, IndicesStatsRequest::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); this.indicesService = indicesService; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteComponentTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteComponentTemplateAction.java index 30cb0cb3e5d00..5f00559cc35e8 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteComponentTemplateAction.java @@ -46,6 +46,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -71,7 +72,8 @@ public TransportDeleteComponentTemplateAction( ThreadPool threadPool, MetadataIndexTemplateService indexTemplateService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( DeleteComponentTemplateAction.NAME, @@ -80,7 +82,8 @@ public TransportDeleteComponentTemplateAction( threadPool, actionFilters, DeleteComponentTemplateAction.Request::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.indexTemplateService = indexTemplateService; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteComposableIndexTemplateAction.java index 27ea64809e3a7..11c45f4efa6fc 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteComposableIndexTemplateAction.java @@ -46,6 +46,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -71,7 +72,8 @@ public TransportDeleteComposableIndexTemplateAction( ThreadPool threadPool, MetadataIndexTemplateService indexTemplateService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( DeleteComposableIndexTemplateAction.NAME, @@ -80,7 +82,8 @@ public TransportDeleteComposableIndexTemplateAction( threadPool, actionFilters, DeleteComposableIndexTemplateAction.Request::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.indexTemplateService = indexTemplateService; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteIndexTemplateAction.java index c9542c7a58810..83352002ab274 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteIndexTemplateAction.java @@ -46,6 +46,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -71,7 +72,8 @@ public TransportDeleteIndexTemplateAction( ThreadPool threadPool, MetadataIndexTemplateService indexTemplateService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( DeleteIndexTemplateAction.NAME, @@ -80,7 +82,8 @@ public TransportDeleteIndexTemplateAction( threadPool, actionFilters, DeleteIndexTemplateRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.indexTemplateService = indexTemplateService; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetComponentTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetComponentTemplateAction.java index e2594cd792cd3..9c3528f601868 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetComponentTemplateAction.java @@ -45,6 +45,7 @@ import org.opensearch.common.regex.Regex; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -67,7 +68,8 @@ public TransportGetComponentTemplateAction( ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( GetComponentTemplateAction.NAME, @@ -76,7 +78,8 @@ public TransportGetComponentTemplateAction( threadPool, actionFilters, GetComponentTemplateAction.Request::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetComposableIndexTemplateAction.java index b1ef32db7274f..4c28ee87b5431 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetComposableIndexTemplateAction.java @@ -45,6 +45,7 @@ import org.opensearch.common.regex.Regex; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -67,7 +68,8 @@ public TransportGetComposableIndexTemplateAction( ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( GetComposableIndexTemplateAction.NAME, @@ -76,7 +78,8 @@ public TransportGetComposableIndexTemplateAction( threadPool, actionFilters, GetComposableIndexTemplateAction.Request::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetIndexTemplatesAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetIndexTemplatesAction.java index 10b4975f7b9d0..c970c79e3bb25 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetIndexTemplatesAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetIndexTemplatesAction.java @@ -43,6 +43,7 @@ import org.opensearch.common.regex.Regex; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -67,7 +68,8 @@ public TransportGetIndexTemplatesAction( ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( GetIndexTemplatesAction.NAME, @@ -76,7 +78,8 @@ public TransportGetIndexTemplatesAction( threadPool, actionFilters, GetIndexTemplatesRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/post/TransportSimulateIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/post/TransportSimulateIndexTemplateAction.java index c1a02d813ffb2..fd960f35ff949 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/post/TransportSimulateIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/post/TransportSimulateIndexTemplateAction.java @@ -58,6 +58,7 @@ import org.opensearch.index.mapper.DocumentMapper; import org.opensearch.index.mapper.MapperService; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -99,7 +100,8 @@ public TransportSimulateIndexTemplateAction( ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, NamedXContentRegistry xContentRegistry, - IndicesService indicesService + IndicesService indicesService, + Tracer tracer ) { super( SimulateIndexTemplateAction.NAME, @@ -108,7 +110,8 @@ public TransportSimulateIndexTemplateAction( threadPool, actionFilters, SimulateIndexTemplateRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.indexTemplateService = indexTemplateService; this.xContentRegistry = xContentRegistry; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/post/TransportSimulateTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/post/TransportSimulateTemplateAction.java index 6565896fd3db2..079d8fe158bff 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/post/TransportSimulateTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/post/TransportSimulateTemplateAction.java @@ -49,6 +49,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -85,7 +86,8 @@ public TransportSimulateTemplateAction( ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, NamedXContentRegistry xContentRegistry, - IndicesService indicesService + IndicesService indicesService, + Tracer tracer ) { super( SimulateTemplateAction.NAME, @@ -94,7 +96,8 @@ public TransportSimulateTemplateAction( threadPool, actionFilters, SimulateTemplateAction.Request::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.indexTemplateService = indexTemplateService; this.xContentRegistry = xContentRegistry; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutComponentTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutComponentTemplateAction.java index 6eb87bee9ffa7..f92c278a9b346 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutComponentTemplateAction.java @@ -49,6 +49,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -74,7 +75,8 @@ public TransportPutComponentTemplateAction( MetadataIndexTemplateService indexTemplateService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - IndexScopedSettings indexScopedSettings + IndexScopedSettings indexScopedSettings, + Tracer tracer ) { super( PutComponentTemplateAction.NAME, @@ -83,7 +85,8 @@ public TransportPutComponentTemplateAction( threadPool, actionFilters, PutComponentTemplateAction.Request::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.indexTemplateService = indexTemplateService; this.indexScopedSettings = indexScopedSettings; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutComposableIndexTemplateAction.java index 8a31c36d723b4..6921bd6fc9fae 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutComposableIndexTemplateAction.java @@ -45,6 +45,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -68,7 +69,8 @@ public TransportPutComposableIndexTemplateAction( ThreadPool threadPool, MetadataIndexTemplateService indexTemplateService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( PutComposableIndexTemplateAction.NAME, @@ -77,7 +79,8 @@ public TransportPutComposableIndexTemplateAction( threadPool, actionFilters, PutComposableIndexTemplateAction.Request::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.indexTemplateService = indexTemplateService; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutIndexTemplateAction.java index 4431949c2e42b..9694a175b84d0 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutIndexTemplateAction.java @@ -49,6 +49,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -74,7 +75,8 @@ public TransportPutIndexTemplateAction( MetadataIndexTemplateService indexTemplateService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - IndexScopedSettings indexScopedSettings + IndexScopedSettings indexScopedSettings, + Tracer tracer ) { super( PutIndexTemplateAction.NAME, @@ -83,7 +85,8 @@ public TransportPutIndexTemplateAction( threadPool, actionFilters, PutIndexTemplateRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.indexTemplateService = indexTemplateService; this.indexScopedSettings = indexScopedSettings; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/TransportUpgradeStatusAction.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/TransportUpgradeStatusAction.java index a171355fb2049..3135f60468aea 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/TransportUpgradeStatusAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/TransportUpgradeStatusAction.java @@ -49,6 +49,7 @@ import org.opensearch.index.engine.Segment; import org.opensearch.index.shard.IndexShard; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -73,7 +74,8 @@ public TransportUpgradeStatusAction( TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( UpgradeStatusAction.NAME, @@ -82,7 +84,8 @@ public TransportUpgradeStatusAction( actionFilters, indexNameExpressionResolver, UpgradeStatusRequest::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); this.indicesService = indicesService; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/TransportUpgradeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/TransportUpgradeAction.java index 2dcd030093a67..af4920e0a7657 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/TransportUpgradeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/TransportUpgradeAction.java @@ -55,6 +55,7 @@ import org.opensearch.index.shard.IndexShard; import org.opensearch.indices.IndicesService; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -82,7 +83,8 @@ public TransportUpgradeAction( IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - NodeClient client + NodeClient client, + Tracer tracer ) { super( UpgradeAction.NAME, @@ -91,7 +93,8 @@ public TransportUpgradeAction( actionFilters, indexNameExpressionResolver, UpgradeRequest::new, - ThreadPool.Names.FORCE_MERGE + ThreadPool.Names.FORCE_MERGE, + tracer ); this.indicesService = indicesService; this.client = client; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/TransportUpgradeSettingsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/TransportUpgradeSettingsAction.java index 286724d78bb63..ac424e544c307 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/TransportUpgradeSettingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/TransportUpgradeSettingsAction.java @@ -48,6 +48,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -71,7 +72,8 @@ public TransportUpgradeSettingsAction( ThreadPool threadPool, MetadataUpdateSettingsService updateSettingsService, IndexNameExpressionResolver indexNameExpressionResolver, - ActionFilters actionFilters + ActionFilters actionFilters, + Tracer tracer ) { super( UpgradeSettingsAction.NAME, @@ -80,7 +82,8 @@ public TransportUpgradeSettingsAction( threadPool, actionFilters, UpgradeSettingsRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.updateSettingsService = updateSettingsService; } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/TransportValidateQueryAction.java b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/TransportValidateQueryAction.java index 2b46fbcb9d105..7eca43c827e27 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/TransportValidateQueryAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/TransportValidateQueryAction.java @@ -61,6 +61,7 @@ import org.opensearch.search.internal.SearchContext; import org.opensearch.search.internal.ShardSearchRequest; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -91,7 +92,8 @@ public TransportValidateQueryAction( TransportService transportService, SearchService searchService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( ValidateQueryAction.NAME, @@ -101,7 +103,8 @@ public TransportValidateQueryAction( indexNameExpressionResolver, ValidateQueryRequest::new, ShardValidateQueryRequest::new, - ThreadPool.Names.SEARCH + ThreadPool.Names.SEARCH, + tracer ); this.searchService = searchService; } diff --git a/server/src/main/java/org/opensearch/action/bulk/TransportBulkAction.java b/server/src/main/java/org/opensearch/action/bulk/TransportBulkAction.java index d8b7facc09df2..4728562b78451 100644 --- a/server/src/main/java/org/opensearch/action/bulk/TransportBulkAction.java +++ b/server/src/main/java/org/opensearch/action/bulk/TransportBulkAction.java @@ -83,6 +83,7 @@ import org.opensearch.ingest.IngestService; import org.opensearch.node.NodeClosedException; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.threadpool.ThreadPool.Names; import org.opensearch.transport.TransportService; @@ -143,7 +144,8 @@ public TransportBulkAction( IndexNameExpressionResolver indexNameExpressionResolver, AutoCreateIndex autoCreateIndex, IndexingPressureService indexingPressureService, - SystemIndices systemIndices + SystemIndices systemIndices, + Tracer tracer ) { this( threadPool, @@ -157,7 +159,8 @@ public TransportBulkAction( autoCreateIndex, indexingPressureService, systemIndices, - System::nanoTime + System::nanoTime, + tracer ); } @@ -173,9 +176,10 @@ public TransportBulkAction( AutoCreateIndex autoCreateIndex, IndexingPressureService indexingPressureService, SystemIndices systemIndices, - LongSupplier relativeTimeProvider + LongSupplier relativeTimeProvider, + Tracer tracer ) { - super(BulkAction.NAME, transportService, actionFilters, BulkRequest::new, ThreadPool.Names.SAME); + super(BulkAction.NAME, transportService, actionFilters, BulkRequest::new, ThreadPool.Names.SAME, tracer); Objects.requireNonNull(relativeTimeProvider); this.threadPool = threadPool; this.clusterService = clusterService; diff --git a/server/src/main/java/org/opensearch/action/bulk/TransportShardBulkAction.java b/server/src/main/java/org/opensearch/action/bulk/TransportShardBulkAction.java index fddda0ef1f9a7..268a6ed6f85b8 100644 --- a/server/src/main/java/org/opensearch/action/bulk/TransportShardBulkAction.java +++ b/server/src/main/java/org/opensearch/action/bulk/TransportShardBulkAction.java @@ -99,6 +99,7 @@ import org.opensearch.indices.SystemIndices; import org.opensearch.node.NodeClosedException; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.threadpool.ThreadPool.Names; import org.opensearch.transport.TransportChannel; @@ -161,7 +162,8 @@ public TransportShardBulkAction( IndexingPressureService indexingPressureService, SegmentReplicationPressureService segmentReplicationPressureService, RemoteStorePressureService remoteStorePressureService, - SystemIndices systemIndices + SystemIndices systemIndices, + Tracer tracer ) { super( settings, @@ -177,7 +179,8 @@ public TransportShardBulkAction( EXECUTOR_NAME_FUNCTION, false, indexingPressureService, - systemIndices + systemIndices, + tracer ); this.updateHelper = updateHelper; this.mappingUpdatedAction = mappingUpdatedAction; diff --git a/server/src/main/java/org/opensearch/action/bulk/TransportSingleItemBulkWriteAction.java b/server/src/main/java/org/opensearch/action/bulk/TransportSingleItemBulkWriteAction.java index 9b901dda24c2b..317ddef0a9236 100644 --- a/server/src/main/java/org/opensearch/action/bulk/TransportSingleItemBulkWriteAction.java +++ b/server/src/main/java/org/opensearch/action/bulk/TransportSingleItemBulkWriteAction.java @@ -43,6 +43,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; /** @@ -62,9 +63,10 @@ protected TransportSingleItemBulkWriteAction( TransportService transportService, ActionFilters actionFilters, Writeable.Reader requestReader, - TransportBulkAction bulkAction + TransportBulkAction bulkAction, + Tracer tracer ) { - super(actionName, transportService, actionFilters, requestReader); + super(actionName, transportService, actionFilters, requestReader, tracer); this.bulkAction = bulkAction; } diff --git a/server/src/main/java/org/opensearch/action/delete/TransportDeleteAction.java b/server/src/main/java/org/opensearch/action/delete/TransportDeleteAction.java index 039214459ac21..4ad8953f2778e 100644 --- a/server/src/main/java/org/opensearch/action/delete/TransportDeleteAction.java +++ b/server/src/main/java/org/opensearch/action/delete/TransportDeleteAction.java @@ -36,6 +36,7 @@ import org.opensearch.action.bulk.TransportSingleItemBulkWriteAction; import org.opensearch.action.support.ActionFilters; import org.opensearch.common.inject.Inject; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; /** @@ -49,7 +50,12 @@ public class TransportDeleteAction extends TransportSingleItemBulkWriteAction { @Inject - public TransportDeleteAction(TransportService transportService, ActionFilters actionFilters, TransportBulkAction bulkAction) { - super(DeleteAction.NAME, transportService, actionFilters, DeleteRequest::new, bulkAction); + public TransportDeleteAction( + TransportService transportService, + ActionFilters actionFilters, + TransportBulkAction bulkAction, + Tracer tracer + ) { + super(DeleteAction.NAME, transportService, actionFilters, DeleteRequest::new, bulkAction, tracer); } } diff --git a/server/src/main/java/org/opensearch/action/explain/TransportExplainAction.java b/server/src/main/java/org/opensearch/action/explain/TransportExplainAction.java index fb2ccc6ebbf12..97e2fe4a545d8 100644 --- a/server/src/main/java/org/opensearch/action/explain/TransportExplainAction.java +++ b/server/src/main/java/org/opensearch/action/explain/TransportExplainAction.java @@ -60,6 +60,7 @@ import org.opensearch.search.rescore.RescoreContext; import org.opensearch.search.rescore.Rescorer; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -83,7 +84,8 @@ public TransportExplainAction( TransportService transportService, SearchService searchService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( ExplainAction.NAME, @@ -93,7 +95,8 @@ public TransportExplainAction( actionFilters, indexNameExpressionResolver, ExplainRequest::new, - ThreadPool.Names.GET + ThreadPool.Names.GET, + tracer ); this.searchService = searchService; } diff --git a/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesAction.java b/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesAction.java index 4c9e10cba52e7..43ca6564adec1 100644 --- a/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesAction.java +++ b/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesAction.java @@ -44,6 +44,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.Strings; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.RemoteClusterAware; import org.opensearch.transport.RemoteClusterService; @@ -77,9 +78,10 @@ public TransportFieldCapabilitiesAction( ThreadPool threadPool, TransportFieldCapabilitiesIndexAction shardAction, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { - super(FieldCapabilitiesAction.NAME, transportService, actionFilters, FieldCapabilitiesRequest::new); + super(FieldCapabilitiesAction.NAME, transportService, actionFilters, FieldCapabilitiesRequest::new, tracer); this.threadPool = threadPool; this.clusterService = clusterService; this.remoteClusterService = transportService.getRemoteClusterService(); diff --git a/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesIndexAction.java b/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesIndexAction.java index 10bf4975311d6..16b48a722da45 100644 --- a/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesIndexAction.java +++ b/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesIndexAction.java @@ -68,6 +68,7 @@ import org.opensearch.search.internal.AliasFilter; import org.opensearch.search.internal.ShardSearchRequest; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportChannel; import org.opensearch.transport.TransportException; @@ -118,9 +119,10 @@ public TransportFieldCapabilitiesIndexAction( SearchService searchService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { - super(ACTION_NAME, transportService, actionFilters, FieldCapabilitiesIndexRequest::new); + super(ACTION_NAME, transportService, actionFilters, FieldCapabilitiesIndexRequest::new, tracer); this.clusterService = clusterService; this.transportService = transportService; this.searchService = searchService; diff --git a/server/src/main/java/org/opensearch/action/get/TransportGetAction.java b/server/src/main/java/org/opensearch/action/get/TransportGetAction.java index 00a795c86356f..7a338e9196bd8 100644 --- a/server/src/main/java/org/opensearch/action/get/TransportGetAction.java +++ b/server/src/main/java/org/opensearch/action/get/TransportGetAction.java @@ -49,6 +49,7 @@ import org.opensearch.index.get.GetResult; import org.opensearch.index.shard.IndexShard; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -70,7 +71,8 @@ public TransportGetAction( IndicesService indicesService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( GetAction.NAME, @@ -80,7 +82,8 @@ public TransportGetAction( actionFilters, indexNameExpressionResolver, GetRequest::new, - ThreadPool.Names.GET + ThreadPool.Names.GET, + tracer ); this.indicesService = indicesService; } diff --git a/server/src/main/java/org/opensearch/action/get/TransportMultiGetAction.java b/server/src/main/java/org/opensearch/action/get/TransportMultiGetAction.java index 8bbfef381aea8..204e1b2326114 100644 --- a/server/src/main/java/org/opensearch/action/get/TransportMultiGetAction.java +++ b/server/src/main/java/org/opensearch/action/get/TransportMultiGetAction.java @@ -46,6 +46,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.index.shard.ShardId; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; import java.util.HashMap; @@ -69,9 +70,10 @@ public TransportMultiGetAction( ClusterService clusterService, TransportShardMultiGetAction shardAction, ActionFilters actionFilters, - IndexNameExpressionResolver resolver + IndexNameExpressionResolver resolver, + Tracer tracer ) { - super(MultiGetAction.NAME, transportService, actionFilters, MultiGetRequest::new); + super(MultiGetAction.NAME, transportService, actionFilters, MultiGetRequest::new, tracer); this.clusterService = clusterService; this.shardAction = shardAction; this.indexNameExpressionResolver = resolver; diff --git a/server/src/main/java/org/opensearch/action/get/TransportShardMultiGetAction.java b/server/src/main/java/org/opensearch/action/get/TransportShardMultiGetAction.java index 27955098d96cd..5b6c12a44a705 100644 --- a/server/src/main/java/org/opensearch/action/get/TransportShardMultiGetAction.java +++ b/server/src/main/java/org/opensearch/action/get/TransportShardMultiGetAction.java @@ -48,6 +48,7 @@ import org.opensearch.index.get.GetResult; import org.opensearch.index.shard.IndexShard; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -71,7 +72,8 @@ public TransportShardMultiGetAction( IndicesService indicesService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( ACTION_NAME, @@ -81,7 +83,8 @@ public TransportShardMultiGetAction( actionFilters, indexNameExpressionResolver, MultiGetShardRequest::new, - ThreadPool.Names.GET + ThreadPool.Names.GET, + tracer ); this.indicesService = indicesService; } diff --git a/server/src/main/java/org/opensearch/action/index/TransportIndexAction.java b/server/src/main/java/org/opensearch/action/index/TransportIndexAction.java index fe4f80bf0c065..a53934ffd9766 100644 --- a/server/src/main/java/org/opensearch/action/index/TransportIndexAction.java +++ b/server/src/main/java/org/opensearch/action/index/TransportIndexAction.java @@ -36,6 +36,7 @@ import org.opensearch.action.bulk.TransportSingleItemBulkWriteAction; import org.opensearch.action.support.ActionFilters; import org.opensearch.common.inject.Inject; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; /** @@ -56,7 +57,12 @@ public class TransportIndexAction extends TransportSingleItemBulkWriteAction { @Inject - public TransportIndexAction(ActionFilters actionFilters, TransportService transportService, TransportBulkAction bulkAction) { - super(IndexAction.NAME, transportService, actionFilters, IndexRequest::new, bulkAction); + public TransportIndexAction( + ActionFilters actionFilters, + TransportService transportService, + TransportBulkAction bulkAction, + Tracer tracer + ) { + super(IndexAction.NAME, transportService, actionFilters, IndexRequest::new, bulkAction, tracer); } } diff --git a/server/src/main/java/org/opensearch/action/ingest/DeletePipelineTransportAction.java b/server/src/main/java/org/opensearch/action/ingest/DeletePipelineTransportAction.java index fe68f06d0d32e..145bd7bd73dff 100644 --- a/server/src/main/java/org/opensearch/action/ingest/DeletePipelineTransportAction.java +++ b/server/src/main/java/org/opensearch/action/ingest/DeletePipelineTransportAction.java @@ -43,6 +43,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.ingest.IngestService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -63,7 +64,8 @@ public DeletePipelineTransportAction( IngestService ingestService, TransportService transportService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( DeletePipelineAction.NAME, @@ -72,7 +74,8 @@ public DeletePipelineTransportAction( threadPool, actionFilters, DeletePipelineRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.ingestService = ingestService; } diff --git a/server/src/main/java/org/opensearch/action/ingest/GetPipelineTransportAction.java b/server/src/main/java/org/opensearch/action/ingest/GetPipelineTransportAction.java index 80333c7346f92..28f59b23e18c4 100644 --- a/server/src/main/java/org/opensearch/action/ingest/GetPipelineTransportAction.java +++ b/server/src/main/java/org/opensearch/action/ingest/GetPipelineTransportAction.java @@ -43,6 +43,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.ingest.IngestService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -61,7 +62,8 @@ public GetPipelineTransportAction( ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( GetPipelineAction.NAME, @@ -70,7 +72,8 @@ public GetPipelineTransportAction( threadPool, actionFilters, GetPipelineRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/ingest/PutPipelineTransportAction.java b/server/src/main/java/org/opensearch/action/ingest/PutPipelineTransportAction.java index e2d206e8c4f6d..4e96382e34d90 100644 --- a/server/src/main/java/org/opensearch/action/ingest/PutPipelineTransportAction.java +++ b/server/src/main/java/org/opensearch/action/ingest/PutPipelineTransportAction.java @@ -49,6 +49,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.ingest.IngestInfo; import org.opensearch.ingest.IngestService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -75,7 +76,8 @@ public PutPipelineTransportAction( ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, IngestService ingestService, - NodeClient client + NodeClient client, + Tracer tracer ) { super( PutPipelineAction.NAME, @@ -84,7 +86,8 @@ public PutPipelineTransportAction( threadPool, actionFilters, PutPipelineRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); // This client is only used to perform an internal implementation detail, // so uses an internal origin context rather than the user context diff --git a/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineTransportAction.java b/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineTransportAction.java index 4753679d370af..6715e7aabbc05 100644 --- a/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineTransportAction.java +++ b/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineTransportAction.java @@ -40,6 +40,7 @@ import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.ingest.IngestService; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -60,13 +61,15 @@ public SimulatePipelineTransportAction( ThreadPool threadPool, TransportService transportService, ActionFilters actionFilters, - IngestService ingestService + IngestService ingestService, + Tracer tracer ) { super( SimulatePipelineAction.NAME, transportService, actionFilters, - (Writeable.Reader) SimulatePipelineRequest::new + (Writeable.Reader) SimulatePipelineRequest::new, + tracer ); this.ingestService = ingestService; this.executionService = new SimulateExecutionService(threadPool); diff --git a/server/src/main/java/org/opensearch/action/main/TransportMainAction.java b/server/src/main/java/org/opensearch/action/main/TransportMainAction.java index b3a075233e754..23d07a56a889e 100644 --- a/server/src/main/java/org/opensearch/action/main/TransportMainAction.java +++ b/server/src/main/java/org/opensearch/action/main/TransportMainAction.java @@ -43,6 +43,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.node.Node; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; /** @@ -60,9 +61,10 @@ public TransportMainAction( Settings settings, TransportService transportService, ActionFilters actionFilters, - ClusterService clusterService + ClusterService clusterService, + Tracer tracer ) { - super(MainAction.NAME, transportService, actionFilters, MainRequest::new); + super(MainAction.NAME, transportService, actionFilters, MainRequest::new, tracer); this.nodeName = Node.NODE_NAME_SETTING.get(settings); this.clusterService = clusterService; } diff --git a/server/src/main/java/org/opensearch/action/resync/TransportResyncReplicationAction.java b/server/src/main/java/org/opensearch/action/resync/TransportResyncReplicationAction.java index 032fe83e2220b..9d60706d1f100 100644 --- a/server/src/main/java/org/opensearch/action/resync/TransportResyncReplicationAction.java +++ b/server/src/main/java/org/opensearch/action/resync/TransportResyncReplicationAction.java @@ -54,6 +54,7 @@ import org.opensearch.indices.IndicesService; import org.opensearch.indices.SystemIndices; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.threadpool.ThreadPool.Names; import org.opensearch.transport.TransportException; @@ -93,7 +94,8 @@ public TransportResyncReplicationAction( ShardStateAction shardStateAction, ActionFilters actionFilters, IndexingPressureService indexingPressureService, - SystemIndices systemIndices + SystemIndices systemIndices, + Tracer tracer ) { super( settings, @@ -109,7 +111,8 @@ public TransportResyncReplicationAction( EXECUTOR_NAME_FUNCTION, true, /* we should never reject resync because of thread pool capacity on primary */ indexingPressureService, - systemIndices + systemIndices, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/search/DeleteSearchPipelineTransportAction.java b/server/src/main/java/org/opensearch/action/search/DeleteSearchPipelineTransportAction.java index ac83a6bb6b765..439b49fda808d 100644 --- a/server/src/main/java/org/opensearch/action/search/DeleteSearchPipelineTransportAction.java +++ b/server/src/main/java/org/opensearch/action/search/DeleteSearchPipelineTransportAction.java @@ -19,6 +19,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.search.pipeline.SearchPipelineService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -40,7 +41,8 @@ public DeleteSearchPipelineTransportAction( SearchPipelineService searchPipelineService, TransportService transportService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( DeleteSearchPipelineAction.NAME, @@ -49,7 +51,8 @@ public DeleteSearchPipelineTransportAction( threadPool, actionFilters, DeleteSearchPipelineRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.searchPipelineService = searchPipelineService; } diff --git a/server/src/main/java/org/opensearch/action/search/GetSearchPipelineTransportAction.java b/server/src/main/java/org/opensearch/action/search/GetSearchPipelineTransportAction.java index a7fcb8f1cfbae..30de832db4355 100644 --- a/server/src/main/java/org/opensearch/action/search/GetSearchPipelineTransportAction.java +++ b/server/src/main/java/org/opensearch/action/search/GetSearchPipelineTransportAction.java @@ -19,6 +19,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.search.pipeline.SearchPipelineService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -39,7 +40,8 @@ public GetSearchPipelineTransportAction( ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( GetSearchPipelineAction.NAME, @@ -48,7 +50,8 @@ public GetSearchPipelineTransportAction( threadPool, actionFilters, GetSearchPipelineRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/search/PutSearchPipelineTransportAction.java b/server/src/main/java/org/opensearch/action/search/PutSearchPipelineTransportAction.java index a92961cdc3fd9..999e60af857fd 100644 --- a/server/src/main/java/org/opensearch/action/search/PutSearchPipelineTransportAction.java +++ b/server/src/main/java/org/opensearch/action/search/PutSearchPipelineTransportAction.java @@ -25,6 +25,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.search.pipeline.SearchPipelineInfo; import org.opensearch.search.pipeline.SearchPipelineService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -51,7 +52,8 @@ public PutSearchPipelineTransportAction( ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, SearchPipelineService searchPipelineService, - NodeClient client + NodeClient client, + Tracer tracer ) { super( PutSearchPipelineAction.NAME, @@ -60,7 +62,8 @@ public PutSearchPipelineTransportAction( threadPool, actionFilters, PutSearchPipelineRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.client = new OriginSettingClient(client, SEARCH_PIPELINE_ORIGIN); this.searchPipelineService = searchPipelineService; diff --git a/server/src/main/java/org/opensearch/action/search/TransportClearScrollAction.java b/server/src/main/java/org/opensearch/action/search/TransportClearScrollAction.java index e67005eb1fb87..ae763531777e8 100644 --- a/server/src/main/java/org/opensearch/action/search/TransportClearScrollAction.java +++ b/server/src/main/java/org/opensearch/action/search/TransportClearScrollAction.java @@ -39,6 +39,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.NamedWriteableRegistry; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; /** @@ -58,9 +59,10 @@ public TransportClearScrollAction( ClusterService clusterService, ActionFilters actionFilters, SearchTransportService searchTransportService, - NamedWriteableRegistry namedWriteableRegistry + NamedWriteableRegistry namedWriteableRegistry, + Tracer tracer ) { - super(ClearScrollAction.NAME, transportService, actionFilters, ClearScrollRequest::new); + super(ClearScrollAction.NAME, transportService, actionFilters, ClearScrollRequest::new, tracer); this.clusterService = clusterService; this.searchTransportService = searchTransportService; this.namedWriteableRegistry = namedWriteableRegistry; diff --git a/server/src/main/java/org/opensearch/action/search/TransportCreatePitAction.java b/server/src/main/java/org/opensearch/action/search/TransportCreatePitAction.java index baa113997f243..99dcfee0f7abe 100644 --- a/server/src/main/java/org/opensearch/action/search/TransportCreatePitAction.java +++ b/server/src/main/java/org/opensearch/action/search/TransportCreatePitAction.java @@ -23,6 +23,7 @@ import org.opensearch.search.SearchPhaseResult; import org.opensearch.search.internal.ShardSearchContextId; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportRequest; import org.opensearch.transport.TransportService; @@ -50,9 +51,10 @@ public TransportCreatePitAction( ClusterService clusterService, TransportSearchAction transportSearchAction, NamedWriteableRegistry namedWriteableRegistry, - CreatePitController createPitController + CreatePitController createPitController, + Tracer tracer ) { - super(CreatePitAction.NAME, transportService, actionFilters, in -> new CreatePitRequest(in)); + super(CreatePitAction.NAME, transportService, actionFilters, in -> new CreatePitRequest(in), tracer); this.transportService = transportService; this.searchTransportService = searchTransportService; this.clusterService = clusterService; diff --git a/server/src/main/java/org/opensearch/action/search/TransportDeletePitAction.java b/server/src/main/java/org/opensearch/action/search/TransportDeletePitAction.java index 614d576324026..4cc5513d5253b 100644 --- a/server/src/main/java/org/opensearch/action/search/TransportDeletePitAction.java +++ b/server/src/main/java/org/opensearch/action/search/TransportDeletePitAction.java @@ -14,6 +14,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.NamedWriteableRegistry; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; import java.util.ArrayList; @@ -36,9 +37,10 @@ public TransportDeletePitAction( TransportService transportService, ActionFilters actionFilters, NamedWriteableRegistry namedWriteableRegistry, - PitService pitService + PitService pitService, + Tracer tracer ) { - super(DeletePitAction.NAME, transportService, actionFilters, DeletePitRequest::new); + super(DeletePitAction.NAME, transportService, actionFilters, DeletePitRequest::new, tracer); this.namedWriteableRegistry = namedWriteableRegistry; this.pitService = pitService; } diff --git a/server/src/main/java/org/opensearch/action/search/TransportGetAllPitsAction.java b/server/src/main/java/org/opensearch/action/search/TransportGetAllPitsAction.java index 561ca034da469..07c2d7cde9e64 100644 --- a/server/src/main/java/org/opensearch/action/search/TransportGetAllPitsAction.java +++ b/server/src/main/java/org/opensearch/action/search/TransportGetAllPitsAction.java @@ -15,6 +15,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.search.SearchService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -37,7 +38,8 @@ public TransportGetAllPitsAction( ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, - SearchService searchService + SearchService searchService, + Tracer tracer ) { super( GetAllPitsAction.NAME, @@ -48,7 +50,8 @@ public TransportGetAllPitsAction( GetAllPitNodesRequest::new, GetAllPitNodeRequest::new, ThreadPool.Names.SAME, - GetAllPitNodeResponse.class + GetAllPitNodeResponse.class, + tracer ); this.searchService = searchService; } diff --git a/server/src/main/java/org/opensearch/action/search/TransportMultiSearchAction.java b/server/src/main/java/org/opensearch/action/search/TransportMultiSearchAction.java index 146b4010af4b3..9f6942f276ad7 100644 --- a/server/src/main/java/org/opensearch/action/search/TransportMultiSearchAction.java +++ b/server/src/main/java/org/opensearch/action/search/TransportMultiSearchAction.java @@ -45,6 +45,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -74,9 +75,16 @@ public TransportMultiSearchAction( TransportService transportService, ClusterService clusterService, ActionFilters actionFilters, - NodeClient client + NodeClient client, + Tracer tracer ) { - super(MultiSearchAction.NAME, transportService, actionFilters, (Writeable.Reader) MultiSearchRequest::new); + super( + MultiSearchAction.NAME, + transportService, + actionFilters, + (Writeable.Reader) MultiSearchRequest::new, + tracer + ); this.threadPool = threadPool; this.clusterService = clusterService; this.allocatedProcessors = OpenSearchExecutors.allocatedProcessors(settings); @@ -91,9 +99,16 @@ public TransportMultiSearchAction( ClusterService clusterService, int allocatedProcessors, LongSupplier relativeTimeProvider, - NodeClient client + NodeClient client, + Tracer tracer ) { - super(MultiSearchAction.NAME, transportService, actionFilters, (Writeable.Reader) MultiSearchRequest::new); + super( + MultiSearchAction.NAME, + transportService, + actionFilters, + (Writeable.Reader) MultiSearchRequest::new, + tracer + ); this.threadPool = threadPool; this.clusterService = clusterService; this.allocatedProcessors = allocatedProcessors; diff --git a/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java b/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java index 25ec0fc57d19f..bdf303e762b0b 100644 --- a/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java +++ b/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java @@ -87,6 +87,7 @@ import org.opensearch.search.profile.SearchProfileShardResults; import org.opensearch.tasks.CancellableTask; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.RemoteClusterAware; import org.opensearch.transport.RemoteClusterService; @@ -170,9 +171,10 @@ public TransportSearchAction( ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, NamedWriteableRegistry namedWriteableRegistry, - SearchPipelineService searchPipelineService + SearchPipelineService searchPipelineService, + Tracer tracer ) { - super(SearchAction.NAME, transportService, actionFilters, (Writeable.Reader) SearchRequest::new); + super(SearchAction.NAME, transportService, actionFilters, (Writeable.Reader) SearchRequest::new, tracer); this.client = client; this.threadPool = threadPool; this.circuitBreaker = circuitBreakerService.getBreaker(CircuitBreaker.REQUEST); diff --git a/server/src/main/java/org/opensearch/action/search/TransportSearchScrollAction.java b/server/src/main/java/org/opensearch/action/search/TransportSearchScrollAction.java index 4713d03c93bac..84b6fa18d6414 100644 --- a/server/src/main/java/org/opensearch/action/search/TransportSearchScrollAction.java +++ b/server/src/main/java/org/opensearch/action/search/TransportSearchScrollAction.java @@ -39,6 +39,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; /** @@ -58,9 +59,16 @@ public TransportSearchScrollAction( ClusterService clusterService, ActionFilters actionFilters, SearchTransportService searchTransportService, - SearchPhaseController searchPhaseController + SearchPhaseController searchPhaseController, + Tracer tracer ) { - super(SearchScrollAction.NAME, transportService, actionFilters, (Writeable.Reader) SearchScrollRequest::new); + super( + SearchScrollAction.NAME, + transportService, + actionFilters, + (Writeable.Reader) SearchScrollRequest::new, + tracer + ); this.clusterService = clusterService; this.searchTransportService = searchTransportService; this.searchPhaseController = searchPhaseController; diff --git a/server/src/main/java/org/opensearch/action/support/HandledTransportAction.java b/server/src/main/java/org/opensearch/action/support/HandledTransportAction.java index 786d8cfb6fa1d..3768711a49f74 100644 --- a/server/src/main/java/org/opensearch/action/support/HandledTransportAction.java +++ b/server/src/main/java/org/opensearch/action/support/HandledTransportAction.java @@ -35,6 +35,7 @@ import org.opensearch.core.action.ActionResponse; import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportChannel; import org.opensearch.transport.TransportRequestHandler; @@ -53,9 +54,10 @@ protected HandledTransportAction( String actionName, TransportService transportService, ActionFilters actionFilters, - Writeable.Reader requestReader + Writeable.Reader requestReader, + Tracer tracer ) { - this(actionName, true, transportService, actionFilters, requestReader); + this(actionName, true, transportService, actionFilters, requestReader, tracer); } protected HandledTransportAction( @@ -63,9 +65,10 @@ protected HandledTransportAction( TransportService transportService, ActionFilters actionFilters, Writeable.Reader requestReader, - String executor + String executor, + Tracer tracer ) { - this(actionName, true, transportService, actionFilters, requestReader, executor); + this(actionName, true, transportService, actionFilters, requestReader, executor, tracer); } protected HandledTransportAction( @@ -73,9 +76,10 @@ protected HandledTransportAction( boolean canTripCircuitBreaker, TransportService transportService, ActionFilters actionFilters, - Writeable.Reader requestReader + Writeable.Reader requestReader, + Tracer tracer ) { - this(actionName, canTripCircuitBreaker, transportService, actionFilters, requestReader, ThreadPool.Names.SAME); + this(actionName, canTripCircuitBreaker, transportService, actionFilters, requestReader, ThreadPool.Names.SAME, tracer); } protected HandledTransportAction( @@ -84,9 +88,10 @@ protected HandledTransportAction( TransportService transportService, ActionFilters actionFilters, Writeable.Reader requestReader, - String executor + String executor, + Tracer tracer ) { - super(actionName, actionFilters, transportService.getTaskManager()); + super(actionName, actionFilters, transportService.getTaskManager(), tracer); transportService.registerRequestHandler(actionName, executor, false, canTripCircuitBreaker, requestReader, new TransportHandler()); } diff --git a/server/src/main/java/org/opensearch/action/support/TransportAction.java b/server/src/main/java/org/opensearch/action/support/TransportAction.java index daa11c2d7d80f..3e3dd61acc125 100644 --- a/server/src/main/java/org/opensearch/action/support/TransportAction.java +++ b/server/src/main/java/org/opensearch/action/support/TransportAction.java @@ -46,6 +46,11 @@ import org.opensearch.tasks.Task; import org.opensearch.tasks.TaskListener; import org.opensearch.tasks.TaskManager; +import org.opensearch.telemetry.tracing.Span; +import org.opensearch.telemetry.tracing.SpanBuilder; +import org.opensearch.telemetry.tracing.SpanScope; +import org.opensearch.telemetry.tracing.Tracer; +import org.opensearch.telemetry.tracing.listener.TraceableActionListener; import java.util.concurrent.atomic.AtomicInteger; @@ -59,16 +64,18 @@ public abstract class TransportAction listener) { - ActionRequestValidationException validationException = request.validate(); - if (validationException != null) { - listener.onFailure(validationException); - return; - } + final Span span = tracer.startSpan(SpanBuilder.from(task, actionName)); + try (final SpanScope spanScope = tracer.withSpanInScope(span)) { + listener = TraceableActionListener.create(listener, span, tracer); + ActionRequestValidationException validationException = request.validate(); + if (validationException != null) { + listener.onFailure(validationException); + return; + } - if (task != null && request.getShouldStoreResult()) { - listener = new TaskResultStoringActionListener<>(taskManager, task, listener); - } + if (task != null && request.getShouldStoreResult()) { + listener = new TaskResultStoringActionListener<>(taskManager, task, listener); + } - RequestFilterChain requestFilterChain = new RequestFilterChain<>(this, logger); - requestFilterChain.proceed(task, actionName, request, listener); + RequestFilterChain requestFilterChain = new RequestFilterChain<>(this, logger); + requestFilterChain.proceed(task, actionName, request, listener); + } catch (Exception e) { + // Some validation scenarios throws the RuntimeException other than validationException. + span.setError(e); + span.endSpan(); + throw e; + } } protected abstract void doExecute(Task task, Request request, ActionListener listener); diff --git a/server/src/main/java/org/opensearch/action/support/broadcast/TransportBroadcastAction.java b/server/src/main/java/org/opensearch/action/support/broadcast/TransportBroadcastAction.java index 8bf8555194976..0e1f3a4db3bf3 100644 --- a/server/src/main/java/org/opensearch/action/support/broadcast/TransportBroadcastAction.java +++ b/server/src/main/java/org/opensearch/action/support/broadcast/TransportBroadcastAction.java @@ -53,6 +53,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportChannel; import org.opensearch.transport.TransportException; @@ -90,9 +91,10 @@ protected TransportBroadcastAction( IndexNameExpressionResolver indexNameExpressionResolver, Writeable.Reader request, Writeable.Reader shardRequest, - String shardExecutor + String shardExecutor, + Tracer tracer ) { - super(actionName, transportService, actionFilters, request); + super(actionName, transportService, actionFilters, request, tracer); this.clusterService = clusterService; this.transportService = transportService; this.indexNameExpressionResolver = indexNameExpressionResolver; diff --git a/server/src/main/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java b/server/src/main/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java index c08cfb7af0e3d..ce8248c183a2b 100644 --- a/server/src/main/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java +++ b/server/src/main/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java @@ -58,6 +58,7 @@ import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.transport.TransportResponse; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.NodeShouldNotConnectException; import org.opensearch.transport.TransportChannel; @@ -107,9 +108,10 @@ public TransportBroadcastByNodeAction( ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, Writeable.Reader request, - String executor + String executor, + Tracer tracer ) { - this(actionName, clusterService, transportService, actionFilters, indexNameExpressionResolver, request, executor, true); + this(actionName, clusterService, transportService, actionFilters, indexNameExpressionResolver, request, executor, true, tracer); } public TransportBroadcastByNodeAction( @@ -120,9 +122,10 @@ public TransportBroadcastByNodeAction( IndexNameExpressionResolver indexNameExpressionResolver, Writeable.Reader request, String executor, - boolean canTripCircuitBreaker + boolean canTripCircuitBreaker, + Tracer tracer ) { - super(actionName, canTripCircuitBreaker, transportService, actionFilters, request); + super(actionName, canTripCircuitBreaker, transportService, actionFilters, request, tracer); this.clusterService = clusterService; this.transportService = transportService; diff --git a/server/src/main/java/org/opensearch/action/support/clustermanager/TransportClusterManagerNodeAction.java b/server/src/main/java/org/opensearch/action/support/clustermanager/TransportClusterManagerNodeAction.java index 536ddcdd402e2..e80ca7b9a5d32 100644 --- a/server/src/main/java/org/opensearch/action/support/clustermanager/TransportClusterManagerNodeAction.java +++ b/server/src/main/java/org/opensearch/action/support/clustermanager/TransportClusterManagerNodeAction.java @@ -62,6 +62,7 @@ import org.opensearch.discovery.ClusterManagerNotDiscoveredException; import org.opensearch.node.NodeClosedException; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.ConnectTransportException; import org.opensearch.transport.RemoteTransportException; @@ -95,9 +96,10 @@ protected TransportClusterManagerNodeAction( ThreadPool threadPool, ActionFilters actionFilters, Writeable.Reader request, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { - this(actionName, true, transportService, clusterService, threadPool, actionFilters, request, indexNameExpressionResolver); + this(actionName, true, transportService, clusterService, threadPool, actionFilters, request, indexNameExpressionResolver, tracer); } protected TransportClusterManagerNodeAction( @@ -108,9 +110,10 @@ protected TransportClusterManagerNodeAction( ThreadPool threadPool, ActionFilters actionFilters, Writeable.Reader request, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { - super(actionName, canTripCircuitBreaker, transportService, actionFilters, request); + super(actionName, canTripCircuitBreaker, transportService, actionFilters, request, tracer); this.transportService = transportService; this.clusterService = clusterService; this.threadPool = threadPool; diff --git a/server/src/main/java/org/opensearch/action/support/clustermanager/TransportClusterManagerNodeReadAction.java b/server/src/main/java/org/opensearch/action/support/clustermanager/TransportClusterManagerNodeReadAction.java index d8cd5af992028..7aff84ce0bff1 100644 --- a/server/src/main/java/org/opensearch/action/support/clustermanager/TransportClusterManagerNodeReadAction.java +++ b/server/src/main/java/org/opensearch/action/support/clustermanager/TransportClusterManagerNodeReadAction.java @@ -37,6 +37,7 @@ import org.opensearch.cluster.service.ClusterService; import org.opensearch.core.action.ActionResponse; import org.opensearch.core.common.io.stream.Writeable; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -57,9 +58,10 @@ protected TransportClusterManagerNodeReadAction( ThreadPool threadPool, ActionFilters actionFilters, Writeable.Reader request, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { - this(actionName, true, transportService, clusterService, threadPool, actionFilters, request, indexNameExpressionResolver); + this(actionName, true, transportService, clusterService, threadPool, actionFilters, request, indexNameExpressionResolver, tracer); } protected TransportClusterManagerNodeReadAction( @@ -70,7 +72,8 @@ protected TransportClusterManagerNodeReadAction( ThreadPool threadPool, ActionFilters actionFilters, Writeable.Reader request, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( actionName, @@ -80,7 +83,8 @@ protected TransportClusterManagerNodeReadAction( threadPool, actionFilters, request, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/support/clustermanager/info/TransportClusterInfoAction.java b/server/src/main/java/org/opensearch/action/support/clustermanager/info/TransportClusterInfoAction.java index 65f00a4731ab5..36ea631a25edb 100644 --- a/server/src/main/java/org/opensearch/action/support/clustermanager/info/TransportClusterInfoAction.java +++ b/server/src/main/java/org/opensearch/action/support/clustermanager/info/TransportClusterInfoAction.java @@ -41,6 +41,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.action.ActionResponse; import org.opensearch.core.common.io.stream.Writeable; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -59,9 +60,10 @@ public TransportClusterInfoAction( ThreadPool threadPool, ActionFilters actionFilters, Writeable.Reader request, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { - super(actionName, transportService, clusterService, threadPool, actionFilters, request, indexNameExpressionResolver); + super(actionName, transportService, clusterService, threadPool, actionFilters, request, indexNameExpressionResolver, tracer); } @Override diff --git a/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeAction.java b/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeAction.java index eec7965bfed02..16df41fcf6fa8 100644 --- a/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeAction.java +++ b/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeAction.java @@ -38,6 +38,7 @@ import org.opensearch.cluster.service.ClusterService; import org.opensearch.core.action.ActionResponse; import org.opensearch.core.common.io.stream.Writeable; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -58,9 +59,10 @@ protected TransportMasterNodeAction( ThreadPool threadPool, ActionFilters actionFilters, Writeable.Reader request, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { - super(actionName, true, transportService, clusterService, threadPool, actionFilters, request, indexNameExpressionResolver); + super(actionName, true, transportService, clusterService, threadPool, actionFilters, request, indexNameExpressionResolver, tracer); } protected TransportMasterNodeAction( @@ -71,7 +73,8 @@ protected TransportMasterNodeAction( ThreadPool threadPool, ActionFilters actionFilters, Writeable.Reader request, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( actionName, @@ -81,7 +84,8 @@ protected TransportMasterNodeAction( threadPool, actionFilters, request, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeReadAction.java b/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeReadAction.java index b95459971737f..dd0911622a24f 100644 --- a/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeReadAction.java +++ b/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeReadAction.java @@ -38,6 +38,7 @@ import org.opensearch.cluster.service.ClusterService; import org.opensearch.core.action.ActionResponse; import org.opensearch.core.common.io.stream.Writeable; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -59,9 +60,10 @@ protected TransportMasterNodeReadAction( ThreadPool threadPool, ActionFilters actionFilters, Writeable.Reader request, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { - super(actionName, true, transportService, clusterService, threadPool, actionFilters, request, indexNameExpressionResolver); + super(actionName, true, transportService, clusterService, threadPool, actionFilters, request, indexNameExpressionResolver, tracer); } protected TransportMasterNodeReadAction( @@ -72,7 +74,8 @@ protected TransportMasterNodeReadAction( ThreadPool threadPool, ActionFilters actionFilters, Writeable.Reader request, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( actionName, @@ -82,7 +85,8 @@ protected TransportMasterNodeReadAction( threadPool, actionFilters, request, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/support/master/info/TransportClusterInfoAction.java b/server/src/main/java/org/opensearch/action/support/master/info/TransportClusterInfoAction.java index 2653e3a658674..6c998c9de8a28 100644 --- a/server/src/main/java/org/opensearch/action/support/master/info/TransportClusterInfoAction.java +++ b/server/src/main/java/org/opensearch/action/support/master/info/TransportClusterInfoAction.java @@ -36,6 +36,7 @@ import org.opensearch.cluster.service.ClusterService; import org.opensearch.core.action.ActionResponse; import org.opensearch.core.common.io.stream.Writeable; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -54,9 +55,10 @@ public TransportClusterInfoAction( ThreadPool threadPool, ActionFilters actionFilters, Writeable.Reader request, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { - super(actionName, transportService, clusterService, threadPool, actionFilters, request, indexNameExpressionResolver); + super(actionName, transportService, clusterService, threadPool, actionFilters, request, indexNameExpressionResolver, tracer); } } diff --git a/server/src/main/java/org/opensearch/action/support/nodes/TransportNodesAction.java b/server/src/main/java/org/opensearch/action/support/nodes/TransportNodesAction.java index 9a1a28dd70636..78e76a409c65a 100644 --- a/server/src/main/java/org/opensearch/action/support/nodes/TransportNodesAction.java +++ b/server/src/main/java/org/opensearch/action/support/nodes/TransportNodesAction.java @@ -44,6 +44,7 @@ import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.NodeShouldNotConnectException; import org.opensearch.transport.TransportChannel; @@ -103,9 +104,10 @@ protected TransportNodesAction( Writeable.Reader nodeRequest, String nodeExecutor, String finalExecutor, - Class nodeResponseClass + Class nodeResponseClass, + Tracer tracer ) { - super(actionName, transportService, actionFilters, request); + super(actionName, transportService, actionFilters, request, tracer); this.threadPool = threadPool; this.clusterService = Objects.requireNonNull(clusterService); this.transportService = Objects.requireNonNull(transportService); @@ -118,7 +120,7 @@ protected TransportNodesAction( /** * Same as {@link #TransportNodesAction(String, ThreadPool, ClusterService, TransportService, ActionFilters, Writeable.Reader, - * Writeable.Reader, String, String, Class)} but executes final response collection on the transport thread except for when the final + * Writeable.Reader, String, String, Class, Tracer)} but executes final response collection on the transport thread except for when the final * node response is received from the local node, in which case {@code nodeExecutor} is used. * This constructor should only be used for actions for which the creation of the final response is fast enough to be safely executed * on a transport thread. @@ -132,7 +134,8 @@ protected TransportNodesAction( Writeable.Reader request, Writeable.Reader nodeRequest, String nodeExecutor, - Class nodeResponseClass + Class nodeResponseClass, + Tracer tracer ) { this( actionName, @@ -144,7 +147,8 @@ protected TransportNodesAction( nodeRequest, nodeExecutor, ThreadPool.Names.SAME, - nodeResponseClass + nodeResponseClass, + tracer ); } diff --git a/server/src/main/java/org/opensearch/action/support/replication/TransportBroadcastReplicationAction.java b/server/src/main/java/org/opensearch/action/support/replication/TransportBroadcastReplicationAction.java index e235adbc162fc..4c1787ec794e0 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/TransportBroadcastReplicationAction.java +++ b/server/src/main/java/org/opensearch/action/support/replication/TransportBroadcastReplicationAction.java @@ -50,6 +50,7 @@ import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.index.shard.ShardId; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; import java.util.ArrayList; @@ -80,9 +81,10 @@ public TransportBroadcastReplicationAction( TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - TransportReplicationAction replicatedBroadcastShardAction + TransportReplicationAction replicatedBroadcastShardAction, + Tracer tracer ) { - super(name, transportService, actionFilters, requestReader); + super(name, transportService, actionFilters, requestReader, tracer); this.replicatedBroadcastShardAction = replicatedBroadcastShardAction; this.clusterService = clusterService; this.indexNameExpressionResolver = indexNameExpressionResolver; diff --git a/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java b/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java index de5a92fdcc4b1..dae670e40f161 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java +++ b/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java @@ -83,6 +83,7 @@ import org.opensearch.indices.IndicesService; import org.opensearch.node.NodeClosedException; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.ConnectTransportException; import org.opensearch.transport.TransportChannel; @@ -162,7 +163,8 @@ protected TransportReplicationAction( ActionFilters actionFilters, Writeable.Reader requestReader, Writeable.Reader replicaRequestReader, - String executor + String executor, + Tracer tracer ) { this( settings, @@ -177,7 +179,8 @@ protected TransportReplicationAction( replicaRequestReader, executor, false, - false + false, + tracer ); } @@ -194,9 +197,10 @@ protected TransportReplicationAction( Writeable.Reader replicaRequestReader, String executor, boolean syncGlobalCheckpointAfterOperation, - boolean forceExecutionOnPrimary + boolean forceExecutionOnPrimary, + Tracer tracer ) { - super(actionName, actionFilters, transportService.getTaskManager()); + super(actionName, actionFilters, transportService.getTaskManager(), tracer); this.threadPool = threadPool; this.transportService = transportService; this.clusterService = clusterService; diff --git a/server/src/main/java/org/opensearch/action/support/replication/TransportWriteAction.java b/server/src/main/java/org/opensearch/action/support/replication/TransportWriteAction.java index 62cbfbde9780a..62aa37c785ef5 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/TransportWriteAction.java +++ b/server/src/main/java/org/opensearch/action/support/replication/TransportWriteAction.java @@ -59,6 +59,7 @@ import org.opensearch.index.translog.Translog.Location; import org.opensearch.indices.IndicesService; import org.opensearch.indices.SystemIndices; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -97,7 +98,8 @@ protected TransportWriteAction( Function executorFunction, boolean forceExecutionOnPrimary, IndexingPressureService indexingPressureService, - SystemIndices systemIndices + SystemIndices systemIndices, + Tracer tracer ) { // We pass ThreadPool.Names.SAME to the super class as we control the dispatching to the // ThreadPool.Names.WRITE/ThreadPool.Names.SYSTEM_WRITE thread pools in this class. @@ -114,7 +116,8 @@ protected TransportWriteAction( replicaRequest, ThreadPool.Names.SAME, true, - forceExecutionOnPrimary + forceExecutionOnPrimary, + tracer ); this.executorFunction = executorFunction; this.indexingPressureService = indexingPressureService; diff --git a/server/src/main/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationAction.java b/server/src/main/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationAction.java index 21d4ba726e86f..d1f04f8e862a2 100644 --- a/server/src/main/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationAction.java +++ b/server/src/main/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationAction.java @@ -55,6 +55,7 @@ import org.opensearch.index.IndexNotFoundException; import org.opensearch.node.NodeClosedException; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.threadpool.ThreadPool.Names; import org.opensearch.transport.ConnectTransportException; @@ -92,9 +93,10 @@ protected TransportInstanceSingleOperationAction( TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - Writeable.Reader request + Writeable.Reader request, + Tracer tracer ) { - super(actionName, transportService, actionFilters, request); + super(actionName, transportService, actionFilters, request, tracer); this.threadPool = threadPool; this.clusterService = clusterService; this.transportService = transportService; diff --git a/server/src/main/java/org/opensearch/action/support/single/shard/TransportSingleShardAction.java b/server/src/main/java/org/opensearch/action/support/single/shard/TransportSingleShardAction.java index df91559a2f8cb..d8ed9bd4a05e2 100644 --- a/server/src/main/java/org/opensearch/action/support/single/shard/TransportSingleShardAction.java +++ b/server/src/main/java/org/opensearch/action/support/single/shard/TransportSingleShardAction.java @@ -57,6 +57,7 @@ import org.opensearch.core.common.logging.LoggerMessageFormat; import org.opensearch.core.index.shard.ShardId; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportChannel; import org.opensearch.transport.TransportException; @@ -94,9 +95,10 @@ protected TransportSingleShardAction( ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, Writeable.Reader request, - String executor + String executor, + Tracer tracer ) { - super(actionName, actionFilters, transportService.getTaskManager()); + super(actionName, actionFilters, transportService.getTaskManager(), tracer); this.threadPool = threadPool; this.clusterService = clusterService; this.transportService = transportService; diff --git a/server/src/main/java/org/opensearch/action/support/tasks/TransportTasksAction.java b/server/src/main/java/org/opensearch/action/support/tasks/TransportTasksAction.java index f33d7161660a3..541aba6bc16a5 100644 --- a/server/src/main/java/org/opensearch/action/support/tasks/TransportTasksAction.java +++ b/server/src/main/java/org/opensearch/action/support/tasks/TransportTasksAction.java @@ -51,6 +51,7 @@ import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.transport.TransportResponse; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.NodeShouldNotConnectException; import org.opensearch.transport.TransportChannel; @@ -98,9 +99,10 @@ protected TransportTasksAction( Writeable.Reader requestReader, Writeable.Reader responsesReader, Writeable.Reader responseReader, - String nodeExecutor + String nodeExecutor, + Tracer tracer ) { - super(actionName, transportService, actionFilters, requestReader); + super(actionName, transportService, actionFilters, requestReader, tracer); this.clusterService = clusterService; this.transportService = transportService; this.transportNodeAction = actionName + "[n]"; diff --git a/server/src/main/java/org/opensearch/action/termvectors/TransportMultiTermVectorsAction.java b/server/src/main/java/org/opensearch/action/termvectors/TransportMultiTermVectorsAction.java index 0364f36106cb0..7d68b5c2f0ad8 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TransportMultiTermVectorsAction.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TransportMultiTermVectorsAction.java @@ -45,6 +45,7 @@ import org.opensearch.core.index.shard.ShardId; import org.opensearch.index.IndexNotFoundException; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; import java.util.HashMap; @@ -68,9 +69,10 @@ public TransportMultiTermVectorsAction( ClusterService clusterService, TransportShardMultiTermsVectorAction shardAction, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { - super(MultiTermVectorsAction.NAME, transportService, actionFilters, MultiTermVectorsRequest::new); + super(MultiTermVectorsAction.NAME, transportService, actionFilters, MultiTermVectorsRequest::new, tracer); this.clusterService = clusterService; this.shardAction = shardAction; this.indexNameExpressionResolver = indexNameExpressionResolver; diff --git a/server/src/main/java/org/opensearch/action/termvectors/TransportShardMultiTermsVectorAction.java b/server/src/main/java/org/opensearch/action/termvectors/TransportShardMultiTermsVectorAction.java index a298e267cca37..47f1d47fed6d4 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TransportShardMultiTermsVectorAction.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TransportShardMultiTermsVectorAction.java @@ -47,6 +47,7 @@ import org.opensearch.index.shard.IndexShard; import org.opensearch.index.termvectors.TermVectorsService; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -70,7 +71,8 @@ public TransportShardMultiTermsVectorAction( IndicesService indicesService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( ACTION_NAME, @@ -80,7 +82,8 @@ public TransportShardMultiTermsVectorAction( actionFilters, indexNameExpressionResolver, MultiTermVectorsShardRequest::new, - ThreadPool.Names.GET + ThreadPool.Names.GET, + tracer ); this.indicesService = indicesService; } diff --git a/server/src/main/java/org/opensearch/action/termvectors/TransportTermVectorsAction.java b/server/src/main/java/org/opensearch/action/termvectors/TransportTermVectorsAction.java index b7e8a29bd4027..c3fb1b2bd26f6 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TransportTermVectorsAction.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TransportTermVectorsAction.java @@ -49,6 +49,7 @@ import org.opensearch.index.shard.IndexShard; import org.opensearch.index.termvectors.TermVectorsService; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -70,7 +71,8 @@ public TransportTermVectorsAction( IndicesService indicesService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( TermVectorsAction.NAME, @@ -80,7 +82,8 @@ public TransportTermVectorsAction( actionFilters, indexNameExpressionResolver, TermVectorsRequest::new, - ThreadPool.Names.GET + ThreadPool.Names.GET, + tracer ); this.indicesService = indicesService; diff --git a/server/src/main/java/org/opensearch/action/update/TransportUpdateAction.java b/server/src/main/java/org/opensearch/action/update/TransportUpdateAction.java index 95735f71a38e7..1b90bb7061fa9 100644 --- a/server/src/main/java/org/opensearch/action/update/TransportUpdateAction.java +++ b/server/src/main/java/org/opensearch/action/update/TransportUpdateAction.java @@ -69,6 +69,7 @@ import org.opensearch.index.shard.IndexShard; import org.opensearch.indices.IndicesService; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.threadpool.ThreadPool.Names; import org.opensearch.transport.TransportService; @@ -104,7 +105,8 @@ public TransportUpdateAction( IndexNameExpressionResolver indexNameExpressionResolver, IndicesService indicesService, AutoCreateIndex autoCreateIndex, - NodeClient client + NodeClient client, + Tracer tracer ) { super( UpdateAction.NAME, @@ -113,7 +115,8 @@ public TransportUpdateAction( transportService, actionFilters, indexNameExpressionResolver, - UpdateRequest::new + UpdateRequest::new, + tracer ); this.updateHelper = updateHelper; this.indicesService = indicesService; diff --git a/server/src/main/java/org/opensearch/extensions/ExtensionsManager.java b/server/src/main/java/org/opensearch/extensions/ExtensionsManager.java index 61a6e2faa09e0..89a851c02a057 100644 --- a/server/src/main/java/org/opensearch/extensions/ExtensionsManager.java +++ b/server/src/main/java/org/opensearch/extensions/ExtensionsManager.java @@ -41,6 +41,7 @@ import org.opensearch.extensions.settings.CustomSettingsRequestHandler; import org.opensearch.extensions.settings.RegisterCustomSettingsRequest; import org.opensearch.identity.IdentityService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.ConnectTransportException; import org.opensearch.transport.TransportException; @@ -143,7 +144,8 @@ public void initializeServicesAndRestHandler( ClusterService clusterService, Settings initialEnvironmentSettings, NodeClient client, - IdentityService identityService + IdentityService identityService, + Tracer tracer ) { this.restActionsRequestHandler = new RestActionsRequestHandler( actionModule.getRestController(), @@ -167,7 +169,8 @@ public void initializeServicesAndRestHandler( transportService, client, actionModule, - this + this, + tracer ); registerRequestHandler(actionModule.getDynamicActionRegistry()); } diff --git a/server/src/main/java/org/opensearch/extensions/NoopExtensionsManager.java b/server/src/main/java/org/opensearch/extensions/NoopExtensionsManager.java index 34aa3ec1367a7..6d499d1594a82 100644 --- a/server/src/main/java/org/opensearch/extensions/NoopExtensionsManager.java +++ b/server/src/main/java/org/opensearch/extensions/NoopExtensionsManager.java @@ -17,6 +17,7 @@ import org.opensearch.extensions.action.ExtensionActionResponse; import org.opensearch.extensions.action.RemoteExtensionActionResponse; import org.opensearch.identity.IdentityService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; import java.io.IOException; @@ -42,7 +43,8 @@ public void initializeServicesAndRestHandler( ClusterService clusterService, Settings initialEnvironmentSettings, NodeClient client, - IdentityService identityService + IdentityService identityService, + Tracer tracer ) { // no-op } diff --git a/server/src/main/java/org/opensearch/extensions/action/ExtensionProxyTransportAction.java b/server/src/main/java/org/opensearch/extensions/action/ExtensionProxyTransportAction.java index f5ec472c3edc4..d9a6880763e18 100644 --- a/server/src/main/java/org/opensearch/extensions/action/ExtensionProxyTransportAction.java +++ b/server/src/main/java/org/opensearch/extensions/action/ExtensionProxyTransportAction.java @@ -16,6 +16,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.extensions.ExtensionsManager; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.transport.TransportService; /** @@ -33,9 +34,10 @@ public ExtensionProxyTransportAction( TransportService transportService, ActionFilters actionFilters, ClusterService clusterService, - ExtensionsManager extensionsManager + ExtensionsManager extensionsManager, + Tracer tracer ) { - super(ExtensionProxyAction.NAME, transportService, actionFilters, ExtensionActionRequest::new); + super(ExtensionProxyAction.NAME, transportService, actionFilters, ExtensionActionRequest::new, tracer); this.extensionsManager = extensionsManager; } diff --git a/server/src/main/java/org/opensearch/extensions/action/ExtensionTransportAction.java b/server/src/main/java/org/opensearch/extensions/action/ExtensionTransportAction.java index 50a3e0036cbb1..2be297fc77115 100644 --- a/server/src/main/java/org/opensearch/extensions/action/ExtensionTransportAction.java +++ b/server/src/main/java/org/opensearch/extensions/action/ExtensionTransportAction.java @@ -14,6 +14,7 @@ import org.opensearch.extensions.ExtensionsManager; import org.opensearch.tasks.Task; import org.opensearch.tasks.TaskManager; +import org.opensearch.telemetry.tracing.Tracer; /** * A proxy transport action used to proxy a transport request from an extension to execute on another extension @@ -28,9 +29,10 @@ public ExtensionTransportAction( String actionName, ActionFilters actionFilters, TaskManager taskManager, - ExtensionsManager extensionsManager + ExtensionsManager extensionsManager, + Tracer tracer ) { - super(actionName, actionFilters, taskManager); + super(actionName, actionFilters, taskManager, tracer); this.extensionsManager = extensionsManager; } diff --git a/server/src/main/java/org/opensearch/extensions/action/ExtensionTransportActionsHandler.java b/server/src/main/java/org/opensearch/extensions/action/ExtensionTransportActionsHandler.java index ac60df1b73764..bc46ea64d31b6 100644 --- a/server/src/main/java/org/opensearch/extensions/action/ExtensionTransportActionsHandler.java +++ b/server/src/main/java/org/opensearch/extensions/action/ExtensionTransportActionsHandler.java @@ -20,6 +20,7 @@ import org.opensearch.extensions.AcknowledgedResponse; import org.opensearch.extensions.DiscoveryExtensionNode; import org.opensearch.extensions.ExtensionsManager; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.ActionNotFoundTransportException; import org.opensearch.transport.TransportException; @@ -50,13 +51,15 @@ public class ExtensionTransportActionsHandler { private final ActionFilters actionFilters; private final DynamicActionRegistry dynamicActionRegistry; private final ExtensionsManager extensionsManager; + private final Tracer tracer; public ExtensionTransportActionsHandler( Map extensionIdMap, TransportService transportService, NodeClient client, ActionModule actionModule, - ExtensionsManager extensionsManager + ExtensionsManager extensionsManager, + Tracer tracer ) { this.extensionIdMap = extensionIdMap; this.transportService = transportService; @@ -64,6 +67,7 @@ public ExtensionTransportActionsHandler( this.actionFilters = actionModule.getActionFilters(); this.dynamicActionRegistry = actionModule.getDynamicActionRegistry(); this.extensionsManager = extensionsManager; + this.tracer = tracer; } /** @@ -81,7 +85,7 @@ void registerAction(String action, String uniqueId) throws IllegalArgumentExcept // Register the action in the action module's dynamic actions map dynamicActionRegistry.registerDynamicAction( new ExtensionAction(uniqueId, action), - new ExtensionTransportAction(action, actionFilters, transportService.getTaskManager(), extensionsManager) + new ExtensionTransportAction(action, actionFilters, transportService.getTaskManager(), extensionsManager, tracer) ); } diff --git a/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayMetaState.java b/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayMetaState.java index 647e3632ea0ca..53cc885482345 100644 --- a/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayMetaState.java +++ b/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayMetaState.java @@ -50,6 +50,7 @@ import org.opensearch.common.unit.TimeValue; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportRequest; import org.opensearch.transport.TransportService; @@ -79,7 +80,8 @@ public TransportNodesListGatewayMetaState( ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, - GatewayMetaState metaState + GatewayMetaState metaState, + Tracer tracer ) { super( ACTION_NAME, @@ -90,7 +92,8 @@ public TransportNodesListGatewayMetaState( Request::new, NodeRequest::new, ThreadPool.Names.GENERIC, - NodeGatewayMetaState.class + NodeGatewayMetaState.class, + tracer ); this.metaState = metaState; } diff --git a/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayStartedShards.java b/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayStartedShards.java index a47893f37a97c..44018bf79ff14 100644 --- a/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayStartedShards.java +++ b/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayStartedShards.java @@ -62,6 +62,7 @@ import org.opensearch.index.store.Store; import org.opensearch.indices.IndicesService; import org.opensearch.indices.replication.checkpoint.ReplicationCheckpoint; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportRequest; import org.opensearch.transport.TransportService; @@ -104,7 +105,8 @@ public TransportNodesListGatewayStartedShards( ActionFilters actionFilters, NodeEnvironment env, IndicesService indicesService, - NamedXContentRegistry namedXContentRegistry + NamedXContentRegistry namedXContentRegistry, + Tracer tracer ) { super( ACTION_NAME, @@ -115,7 +117,8 @@ public TransportNodesListGatewayStartedShards( Request::new, NodeRequest::new, ThreadPool.Names.FETCH_SHARD_STARTED, - NodeGatewayStartedShards.class + NodeGatewayStartedShards.class, + tracer ); this.settings = settings; this.nodeEnv = env; diff --git a/server/src/main/java/org/opensearch/index/seqno/GlobalCheckpointSyncAction.java b/server/src/main/java/org/opensearch/index/seqno/GlobalCheckpointSyncAction.java index ca1dfe2d5ad01..e4f0f7edca62d 100644 --- a/server/src/main/java/org/opensearch/index/seqno/GlobalCheckpointSyncAction.java +++ b/server/src/main/java/org/opensearch/index/seqno/GlobalCheckpointSyncAction.java @@ -51,6 +51,7 @@ import org.opensearch.index.shard.IndexShardClosedException; import org.opensearch.index.translog.Translog; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -78,7 +79,8 @@ public GlobalCheckpointSyncAction( final IndicesService indicesService, final ThreadPool threadPool, final ShardStateAction shardStateAction, - final ActionFilters actionFilters + final ActionFilters actionFilters, + final Tracer tracer ) { super( settings, @@ -91,7 +93,8 @@ public GlobalCheckpointSyncAction( actionFilters, Request::new, Request::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); } diff --git a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseActions.java b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseActions.java index db8b06489f2ae..dd851b4f6d9d9 100644 --- a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseActions.java +++ b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseActions.java @@ -52,6 +52,7 @@ import org.opensearch.index.IndexService; import org.opensearch.index.shard.IndexShard; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -89,7 +90,8 @@ abstract static class TransportRetentionLeaseAction> extend final ActionFilters actionFilters, final IndexNameExpressionResolver indexNameExpressionResolver, final IndicesService indicesService, - final Writeable.Reader requestSupplier + final Writeable.Reader requestSupplier, + final Tracer tracer ) { super( name, @@ -99,7 +101,8 @@ abstract static class TransportRetentionLeaseAction> extend actionFilters, indexNameExpressionResolver, requestSupplier, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); this.indicesService = Objects.requireNonNull(indicesService); } @@ -167,7 +170,8 @@ public TransportAction( final TransportService transportService, final ActionFilters actionFilters, final IndexNameExpressionResolver indexNameExpressionResolver, - final IndicesService indicesService + final IndicesService indicesService, + final Tracer tracer ) { super( ACTION_NAME, @@ -177,7 +181,8 @@ public TransportAction( actionFilters, indexNameExpressionResolver, indicesService, - AddRequest::new + AddRequest::new, + tracer ); } @@ -227,7 +232,8 @@ public TransportAction( final TransportService transportService, final ActionFilters actionFilters, final IndexNameExpressionResolver indexNameExpressionResolver, - final IndicesService indicesService + final IndicesService indicesService, + final Tracer tracer ) { super( ACTION_NAME, @@ -237,7 +243,8 @@ public TransportAction( actionFilters, indexNameExpressionResolver, indicesService, - RenewRequest::new + RenewRequest::new, + tracer ); } @@ -278,7 +285,8 @@ public TransportAction( final TransportService transportService, final ActionFilters actionFilters, final IndexNameExpressionResolver indexNameExpressionResolver, - final IndicesService indicesService + final IndicesService indicesService, + final Tracer tracer ) { super( ACTION_NAME, @@ -288,7 +296,8 @@ public TransportAction( actionFilters, indexNameExpressionResolver, indicesService, - RemoveRequest::new + RemoveRequest::new, + tracer ); } diff --git a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncAction.java b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncAction.java index 5fa0a1a6459e7..3c13ad863b6ef 100644 --- a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncAction.java +++ b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncAction.java @@ -59,6 +59,7 @@ import org.opensearch.indices.IndicesService; import org.opensearch.node.NodeClosedException; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportException; import org.opensearch.transport.TransportResponseHandler; @@ -96,7 +97,8 @@ public RetentionLeaseBackgroundSyncAction( final IndicesService indicesService, final ThreadPool threadPool, final ShardStateAction shardStateAction, - final ActionFilters actionFilters + final ActionFilters actionFilters, + final Tracer tracer ) { super( settings, @@ -109,7 +111,8 @@ public RetentionLeaseBackgroundSyncAction( actionFilters, Request::new, Request::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); } diff --git a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncAction.java b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncAction.java index f74fc7eefe65c..ca3c7e1d49700 100644 --- a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncAction.java +++ b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncAction.java @@ -62,6 +62,7 @@ import org.opensearch.indices.IndicesService; import org.opensearch.indices.SystemIndices; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportException; import org.opensearch.transport.TransportResponseHandler; @@ -99,7 +100,8 @@ public RetentionLeaseSyncAction( final ShardStateAction shardStateAction, final ActionFilters actionFilters, final IndexingPressureService indexingPressureService, - final SystemIndices systemIndices + final SystemIndices systemIndices, + final Tracer tracer ) { super( settings, @@ -115,7 +117,8 @@ public RetentionLeaseSyncAction( ignore -> ThreadPool.Names.MANAGEMENT, false, indexingPressureService, - systemIndices + systemIndices, + tracer ); } diff --git a/server/src/main/java/org/opensearch/indices/replication/checkpoint/PublishCheckpointAction.java b/server/src/main/java/org/opensearch/indices/replication/checkpoint/PublishCheckpointAction.java index 76f0d333db977..ff236799c73bb 100644 --- a/server/src/main/java/org/opensearch/indices/replication/checkpoint/PublishCheckpointAction.java +++ b/server/src/main/java/org/opensearch/indices/replication/checkpoint/PublishCheckpointAction.java @@ -34,6 +34,7 @@ import org.opensearch.indices.replication.common.ReplicationTimer; import org.opensearch.node.NodeClosedException; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportException; import org.opensearch.transport.TransportResponseHandler; @@ -67,7 +68,8 @@ public PublishCheckpointAction( ThreadPool threadPool, ShardStateAction shardStateAction, ActionFilters actionFilters, - SegmentReplicationTargetService targetService + SegmentReplicationTargetService targetService, + Tracer tracer ) { super( settings, @@ -80,7 +82,8 @@ public PublishCheckpointAction( actionFilters, PublishCheckpointRequest::new, PublishCheckpointRequest::new, - ThreadPool.Names.REFRESH + ThreadPool.Names.REFRESH, + tracer ); this.replicationService = targetService; } diff --git a/server/src/main/java/org/opensearch/indices/store/TransportNodesListShardStoreMetadata.java b/server/src/main/java/org/opensearch/indices/store/TransportNodesListShardStoreMetadata.java index 0afeae253ae14..0bb198b3a4f17 100644 --- a/server/src/main/java/org/opensearch/indices/store/TransportNodesListShardStoreMetadata.java +++ b/server/src/main/java/org/opensearch/indices/store/TransportNodesListShardStoreMetadata.java @@ -65,6 +65,7 @@ import org.opensearch.index.store.Store; import org.opensearch.index.store.StoreFileMetadata; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportRequest; import org.opensearch.transport.TransportService; @@ -106,7 +107,8 @@ public TransportNodesListShardStoreMetadata( TransportService transportService, IndicesService indicesService, NodeEnvironment nodeEnv, - ActionFilters actionFilters + ActionFilters actionFilters, + Tracer tracer ) { super( ACTION_NAME, @@ -117,7 +119,8 @@ public TransportNodesListShardStoreMetadata( Request::new, NodeRequest::new, ThreadPool.Names.FETCH_SHARD_STORE, - NodeStoreFilesMetadata.class + NodeStoreFilesMetadata.class, + tracer ); this.settings = settings; this.indicesService = indicesService; diff --git a/server/src/main/java/org/opensearch/node/Node.java b/server/src/main/java/org/opensearch/node/Node.java index 1f8f17f8e8d91..7658e05600899 100644 --- a/server/src/main/java/org/opensearch/node/Node.java +++ b/server/src/main/java/org/opensearch/node/Node.java @@ -874,6 +874,7 @@ protected Node( clusterService.getClusterSettings(), tracer ); + Collection>> indexTemplateMetadataUpgraders = pluginsService.filterPlugins( Plugin.class ).stream().map(Plugin::getIndexTemplateMetadataUpgrader).collect(Collectors.toList()); @@ -914,7 +915,8 @@ protected Node( clusterService, environment.settings(), client, - identityService + identityService, + tracer ); final PersistedStateRegistry persistedStateRegistry = new PersistedStateRegistry(); final GatewayMetaState gatewayMetaState = new GatewayMetaState(); @@ -970,7 +972,8 @@ protected Node( clusterModule.getIndexNameExpressionResolver(), repositoryService, transportService, - actionModule.getActionFilters() + actionModule.getActionFilters(), + tracer ); SnapshotShardsService snapshotShardsService = new SnapshotShardsService( settings, @@ -984,7 +987,8 @@ protected Node( clusterService, transportService, snapshotShardsService, - actionModule.getActionFilters() + actionModule.getActionFilters(), + tracer ); RestoreService restoreService = new RestoreService( clusterService, diff --git a/server/src/main/java/org/opensearch/persistent/CompletionPersistentTaskAction.java b/server/src/main/java/org/opensearch/persistent/CompletionPersistentTaskAction.java index e43a67ea82fdd..bf677ccc6dd6b 100644 --- a/server/src/main/java/org/opensearch/persistent/CompletionPersistentTaskAction.java +++ b/server/src/main/java/org/opensearch/persistent/CompletionPersistentTaskAction.java @@ -47,6 +47,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -162,7 +163,8 @@ public TransportAction( ThreadPool threadPool, ActionFilters actionFilters, PersistentTasksClusterService persistentTasksClusterService, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( CompletionPersistentTaskAction.NAME, @@ -171,7 +173,8 @@ public TransportAction( threadPool, actionFilters, Request::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.persistentTasksClusterService = persistentTasksClusterService; } diff --git a/server/src/main/java/org/opensearch/persistent/RemovePersistentTaskAction.java b/server/src/main/java/org/opensearch/persistent/RemovePersistentTaskAction.java index 45fe8917095c3..ac476f19ae885 100644 --- a/server/src/main/java/org/opensearch/persistent/RemovePersistentTaskAction.java +++ b/server/src/main/java/org/opensearch/persistent/RemovePersistentTaskAction.java @@ -47,6 +47,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -150,7 +151,8 @@ public TransportAction( ThreadPool threadPool, ActionFilters actionFilters, PersistentTasksClusterService persistentTasksClusterService, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( RemovePersistentTaskAction.NAME, @@ -159,7 +161,8 @@ public TransportAction( threadPool, actionFilters, Request::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.persistentTasksClusterService = persistentTasksClusterService; } diff --git a/server/src/main/java/org/opensearch/persistent/StartPersistentTaskAction.java b/server/src/main/java/org/opensearch/persistent/StartPersistentTaskAction.java index c839fb72c4d05..fcd0cb17490c9 100644 --- a/server/src/main/java/org/opensearch/persistent/StartPersistentTaskAction.java +++ b/server/src/main/java/org/opensearch/persistent/StartPersistentTaskAction.java @@ -48,6 +48,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -214,7 +215,8 @@ public TransportAction( PersistentTasksClusterService persistentTasksClusterService, PersistentTasksExecutorRegistry persistentTasksExecutorRegistry, PersistentTasksService persistentTasksService, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( StartPersistentTaskAction.NAME, @@ -223,7 +225,8 @@ public TransportAction( threadPool, actionFilters, Request::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.persistentTasksClusterService = persistentTasksClusterService; NodePersistentTasksExecutor executor = new NodePersistentTasksExecutor(threadPool); diff --git a/server/src/main/java/org/opensearch/persistent/UpdatePersistentTaskStatusAction.java b/server/src/main/java/org/opensearch/persistent/UpdatePersistentTaskStatusAction.java index 030b3d231cdd3..698d92b2690a0 100644 --- a/server/src/main/java/org/opensearch/persistent/UpdatePersistentTaskStatusAction.java +++ b/server/src/main/java/org/opensearch/persistent/UpdatePersistentTaskStatusAction.java @@ -47,6 +47,7 @@ import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -182,7 +183,8 @@ public TransportAction( ThreadPool threadPool, ActionFilters actionFilters, PersistentTasksClusterService persistentTasksClusterService, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( UpdatePersistentTaskStatusAction.NAME, @@ -191,7 +193,8 @@ public TransportAction( threadPool, actionFilters, Request::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); this.persistentTasksClusterService = persistentTasksClusterService; } diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java b/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java index 1f063bfed8cfe..0a0466cb7985c 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java @@ -100,6 +100,7 @@ import org.opensearch.repositories.RepositoryMissingException; import org.opensearch.repositories.RepositoryShardId; import org.opensearch.repositories.ShardGenerations; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -205,7 +206,8 @@ public SnapshotsService( IndexNameExpressionResolver indexNameExpressionResolver, RepositoriesService repositoriesService, TransportService transportService, - ActionFilters actionFilters + ActionFilters actionFilters, + Tracer tracer ) { this.clusterService = clusterService; this.indexNameExpressionResolver = indexNameExpressionResolver; @@ -220,7 +222,8 @@ public SnapshotsService( clusterService, threadPool, actionFilters, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); if (DiscoveryNode.isClusterManagerNode(settings)) { // addLowPriorityApplier to make sure that Repository will be created before snapshot @@ -3182,7 +3185,8 @@ private class UpdateSnapshotStatusAction extends TransportClusterManagerNodeActi ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver + IndexNameExpressionResolver indexNameExpressionResolver, + Tracer tracer ) { super( UPDATE_SNAPSHOT_STATUS_ACTION_NAME, @@ -3192,7 +3196,8 @@ private class UpdateSnapshotStatusAction extends TransportClusterManagerNodeActi threadPool, actionFilters, UpdateIndexShardSnapshotStatusRequest::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); } diff --git a/server/src/main/java/org/opensearch/telemetry/tracing/AttributeNames.java b/server/src/main/java/org/opensearch/telemetry/tracing/AttributeNames.java index e86b21ae0fd3b..0dbc146e4566b 100644 --- a/server/src/main/java/org/opensearch/telemetry/tracing/AttributeNames.java +++ b/server/src/main/java/org/opensearch/telemetry/tracing/AttributeNames.java @@ -64,4 +64,14 @@ private AttributeNames() { * Action Name. */ public static final String TRANSPORT_ACTION = "action"; + + /** + * task id. + */ + public static final String TASK_ID = "task_id"; + + /** + * parent task id. + */ + public static final String PARENT_TASK_ID = "p_task_id"; } diff --git a/server/src/main/java/org/opensearch/telemetry/tracing/SpanBuilder.java b/server/src/main/java/org/opensearch/telemetry/tracing/SpanBuilder.java index d247d48389fc8..cef9ec12e1eec 100644 --- a/server/src/main/java/org/opensearch/telemetry/tracing/SpanBuilder.java +++ b/server/src/main/java/org/opensearch/telemetry/tracing/SpanBuilder.java @@ -12,6 +12,7 @@ import org.opensearch.core.common.Strings; import org.opensearch.http.HttpRequest; import org.opensearch.rest.RestRequest; +import org.opensearch.tasks.Task; import org.opensearch.telemetry.tracing.attributes.Attributes; import org.opensearch.transport.Transport; @@ -127,4 +128,28 @@ private static Attributes buildSpanAttributes(String action, Transport.Connectio return attributes; } + public static SpanCreationContext from(Task task, String actionName) { + return new SpanCreationContext(createSpanName(task, actionName), buildSpanAttributes(task, actionName)); + } + + private static Attributes buildSpanAttributes(Task task, String actionName) { + Attributes attributes = Attributes.create().addAttribute(AttributeNames.TRANSPORT_ACTION, actionName); + if (task != null) { + attributes.addAttribute(AttributeNames.TASK_ID, task.getId()); + if (task.getParentTaskId() != null && task.getParentTaskId().isSet()) { + attributes.addAttribute(AttributeNames.PARENT_TASK_ID, task.getParentTaskId().getId()); + } + } + return attributes; + + } + + private static String createSpanName(Task task, String actionName) { + if (task != null) { + return task.getType() + SEPARATOR + task.getAction(); + } else { + return actionName; + } + } + } diff --git a/server/src/test/java/org/opensearch/action/ActionModuleTests.java b/server/src/test/java/org/opensearch/action/ActionModuleTests.java index deb0bb58a5c4d..f31079ff55c1f 100644 --- a/server/src/test/java/org/opensearch/action/ActionModuleTests.java +++ b/server/src/test/java/org/opensearch/action/ActionModuleTests.java @@ -59,6 +59,7 @@ import org.opensearch.rest.action.RestMainAction; import org.opensearch.tasks.Task; import org.opensearch.tasks.TaskManager; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.TestThreadPool; import org.opensearch.threadpool.ThreadPool; @@ -102,8 +103,8 @@ public ActionRequestValidationException validate() { } } class FakeTransportAction extends TransportAction { - protected FakeTransportAction(String actionName, ActionFilters actionFilters, TaskManager taskManager) { - super(actionName, actionFilters, taskManager); + protected FakeTransportAction(String actionName, ActionFilters actionFilters, TaskManager taskManager, Tracer tracer) { + super(actionName, actionFilters, taskManager, tracer); } @Override diff --git a/server/src/test/java/org/opensearch/action/DynamicActionRegistryTests.java b/server/src/test/java/org/opensearch/action/DynamicActionRegistryTests.java index 20c2b1f17124c..3ffce7d7d7336 100644 --- a/server/src/test/java/org/opensearch/action/DynamicActionRegistryTests.java +++ b/server/src/test/java/org/opensearch/action/DynamicActionRegistryTests.java @@ -23,6 +23,7 @@ import org.opensearch.rest.RestRequest; import org.opensearch.tasks.Task; import org.opensearch.tasks.TaskManager; +import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; @@ -48,7 +49,13 @@ public void testDynamicActionRegistry() { // ExtensionsAction not yet registered ExtensionAction testExtensionAction = new ExtensionAction("extensionId", "actionName"); - ExtensionTransportAction testExtensionTransportAction = new ExtensionTransportAction("test-action", emptyFilters, null, null); + ExtensionTransportAction testExtensionTransportAction = new ExtensionTransportAction( + "test-action", + emptyFilters, + null, + null, + NoopTracer.INSTANCE + ); assertNull(dynamicActionRegistry.get(testExtensionAction)); // Register an extension action @@ -141,7 +148,7 @@ public ActionResponse read(StreamInput in) throws IOException { private static final class TestTransportAction extends TransportAction { protected TestTransportAction(String actionName, ActionFilters actionFilters, TaskManager taskManager) { - super(actionName, actionFilters, taskManager); + super(actionName, actionFilters, taskManager, NoopTracer.INSTANCE); } @Override diff --git a/server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java index a015e671f4872..8e874064fb72a 100644 --- a/server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java @@ -161,7 +161,8 @@ public void setupForTest() { clusterService, threadPool, new ActionFilters(emptySet()), - new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY)) + new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY)), + NoopTracer.INSTANCE ); // registers action transportService.start(); diff --git a/server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsActionTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsActionTests.java index 10e4ab6388be4..12bc7466d727e 100644 --- a/server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsActionTests.java @@ -121,7 +121,8 @@ public void setupForTest() { clusterService, threadPool, new ActionFilters(emptySet()), - new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY)) + new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY)), + NoopTracer.INSTANCE ); // registers action transportService.start(); diff --git a/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TaskManagerTestCase.java b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TaskManagerTestCase.java index 07e149dd72164..79d3d66745965 100644 --- a/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TaskManagerTestCase.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TaskManagerTestCase.java @@ -177,7 +177,8 @@ abstract class AbstractTestNodesAction { @Inject - public TransportTestTaskAction(ThreadPool threadPool, ClusterService clusterService, TransportService transportService) { + public TransportTestTaskAction( + ThreadPool threadPool, + ClusterService clusterService, + TransportService transportService, + Tracer tracer + ) { super( TestTaskAction.NAME, threadPool, @@ -296,7 +302,8 @@ public TransportTestTaskAction(ThreadPool threadPool, ClusterService clusterServ NodesRequest::new, NodeRequest::new, ThreadPool.Names.GENERIC, - NodeResponse.class + NodeResponse.class, + tracer ); } @@ -428,7 +435,7 @@ public static class TransportUnblockTestTasksAction extends TransportTasksAction UnblockTestTaskResponse> { @Inject - public TransportUnblockTestTasksAction(ClusterService clusterService, TransportService transportService) { + public TransportUnblockTestTasksAction(ClusterService clusterService, TransportService transportService, Tracer tracer) { super( UnblockTestTasksAction.NAME, clusterService, @@ -437,7 +444,8 @@ public TransportUnblockTestTasksAction(ClusterService clusterService, TransportS UnblockTestTasksRequest::new, UnblockTestTasksResponse::new, UnblockTestTaskResponse::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); } diff --git a/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TransportTasksActionTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TransportTasksActionTests.java index 0759d9a0d4640..aacf57cfc4e66 100644 --- a/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TransportTasksActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TransportTasksActionTests.java @@ -63,6 +63,7 @@ import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.tasks.Task; import org.opensearch.tasks.TaskInfo; +import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.tasks.MockTaskManager; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportRequest; @@ -247,7 +248,8 @@ protected TestTasksAction(String actionName, ClusterService clusterService, Tran TestTasksRequest::new, TestTasksResponse::new, TestTaskResponse::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + NoopTracer.INSTANCE ); } diff --git a/server/src/test/java/org/opensearch/action/admin/cluster/remotestore/stats/TransportRemoteStoreStatsActionTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/remotestore/stats/TransportRemoteStoreStatsActionTests.java index ed73c2ef6ace5..ddd778eefd99e 100644 --- a/server/src/test/java/org/opensearch/action/admin/cluster/remotestore/stats/TransportRemoteStoreStatsActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/remotestore/stats/TransportRemoteStoreStatsActionTests.java @@ -99,7 +99,8 @@ public void setUp() throws Exception { indicesService, mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), - remoteStoreStatsTrackerFactory + remoteStoreStatsTrackerFactory, + NoopTracer.INSTANCE ); } diff --git a/server/src/test/java/org/opensearch/action/admin/indices/cache/clear/TransportClearIndicesCacheActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/cache/clear/TransportClearIndicesCacheActionTests.java index 1abd4c06e50e7..9c3af4147187c 100644 --- a/server/src/test/java/org/opensearch/action/admin/indices/cache/clear/TransportClearIndicesCacheActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/cache/clear/TransportClearIndicesCacheActionTests.java @@ -30,6 +30,7 @@ import org.opensearch.index.store.remote.filecache.FileCacheTests; import org.opensearch.indices.IndicesService; import org.opensearch.node.Node; +import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.transport.TransportService; @@ -49,7 +50,8 @@ public class TransportClearIndicesCacheActionTests extends OpenSearchTestCase { mock(IndicesService.class), testNode, mock(ActionFilters.class), - mock(IndexNameExpressionResolver.class) + mock(IndexNameExpressionResolver.class), + NoopTracer.INSTANCE ); private final ClusterBlock writeClusterBlock = new ClusterBlock( diff --git a/server/src/test/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseActionTests.java index ef26bc225b0c7..175dbccbfa210 100644 --- a/server/src/test/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseActionTests.java @@ -154,7 +154,8 @@ public void setUp() throws Exception { mock(IndicesService.class), mock(ThreadPool.class), shardStateAction, - mock(ActionFilters.class) + mock(ActionFilters.class), + NoopTracer.INSTANCE ); } @@ -351,7 +352,8 @@ private TransportVerifyShardBeforeCloseAction createAction() { mock(IndicesService.class), mock(ThreadPool.class), mock(ShardStateAction.class), - mock(ActionFilters.class) + mock(ActionFilters.class), + NoopTracer.INSTANCE ); } diff --git a/server/src/test/java/org/opensearch/action/admin/indices/flush/TransportShardFlushActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/flush/TransportShardFlushActionTests.java index 09215088bd04b..7c23e27962559 100644 --- a/server/src/test/java/org/opensearch/action/admin/indices/flush/TransportShardFlushActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/flush/TransportShardFlushActionTests.java @@ -16,6 +16,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.index.shard.IndexShard; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -50,7 +51,8 @@ private TransportShardFlushAction createAction() { mock(IndicesService.class), mock(ThreadPool.class), mock(ShardStateAction.class), - mock(ActionFilters.class) + mock(ActionFilters.class), + NoopTracer.INSTANCE ); } } diff --git a/server/src/test/java/org/opensearch/action/admin/indices/get/GetIndexActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/get/GetIndexActionTests.java index 2d9ec2b6d3c02..ee081755dd8c5 100644 --- a/server/src/test/java/org/opensearch/action/admin/indices/get/GetIndexActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/get/GetIndexActionTests.java @@ -146,7 +146,8 @@ class TestTransportGetIndexAction extends TransportGetIndexAction { new ActionFilters(emptySet()), new GetIndexActionTests.Resolver(), indicesService, - IndexScopedSettings.DEFAULT_SCOPED_SETTINGS + IndexScopedSettings.DEFAULT_SCOPED_SETTINGS, + NoopTracer.INSTANCE ); } diff --git a/server/src/test/java/org/opensearch/action/admin/indices/readonly/TransportVerifyShardIndexBlockActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/readonly/TransportVerifyShardIndexBlockActionTests.java index 8c4a6c023f9a5..184d2b7e04930 100644 --- a/server/src/test/java/org/opensearch/action/admin/indices/readonly/TransportVerifyShardIndexBlockActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/readonly/TransportVerifyShardIndexBlockActionTests.java @@ -16,6 +16,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.index.shard.IndexShard; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -50,7 +51,8 @@ private TransportVerifyShardIndexBlockAction createAction() { mock(IndicesService.class), mock(ThreadPool.class), mock(ShardStateAction.class), - mock(ActionFilters.class) + mock(ActionFilters.class), + NoopTracer.INSTANCE ); } } diff --git a/server/src/test/java/org/opensearch/action/admin/indices/refresh/TransportShardRefreshActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/refresh/TransportShardRefreshActionTests.java index b2eee904bad38..f407509832599 100644 --- a/server/src/test/java/org/opensearch/action/admin/indices/refresh/TransportShardRefreshActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/refresh/TransportShardRefreshActionTests.java @@ -16,6 +16,7 @@ import org.opensearch.common.settings.Settings; import org.opensearch.index.shard.IndexShard; import org.opensearch.indices.IndicesService; +import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -50,7 +51,8 @@ private TransportShardRefreshAction createAction() { mock(IndicesService.class), mock(ThreadPool.class), mock(ShardStateAction.class), - mock(ActionFilters.class) + mock(ActionFilters.class), + NoopTracer.INSTANCE ); } } diff --git a/server/src/test/java/org/opensearch/action/admin/indices/rollover/TransportRolloverActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/rollover/TransportRolloverActionTests.java index fb4e955e95ab9..1b4efa9c65405 100644 --- a/server/src/test/java/org/opensearch/action/admin/indices/rollover/TransportRolloverActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/rollover/TransportRolloverActionTests.java @@ -80,6 +80,7 @@ import org.opensearch.index.warmer.WarmerStats; import org.opensearch.search.suggest.completion.CompletionStats; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -290,7 +291,8 @@ public void testConditionEvaluationWhenAliasToWriteAndReadIndicesConsidersOnlyPr mockActionFilters, mockIndexNameExpressionResolver, rolloverService, - mockClient + mockClient, + NoopTracer.INSTANCE ); // For given alias, verify that condition evaluation fails when the condition doc count is greater than the primaries doc count diff --git a/server/src/test/java/org/opensearch/action/admin/indices/settings/get/GetSettingsActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/settings/get/GetSettingsActionTests.java index f2b6688716e70..cbe05b4bcdcb7 100644 --- a/server/src/test/java/org/opensearch/action/admin/indices/settings/get/GetSettingsActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/settings/get/GetSettingsActionTests.java @@ -80,7 +80,8 @@ class TestTransportGetSettingsAction extends TransportGetSettingsAction { settingsFilter, new ActionFilters(Collections.emptySet()), new Resolver(), - IndexScopedSettings.DEFAULT_SCOPED_SETTINGS + IndexScopedSettings.DEFAULT_SCOPED_SETTINGS, + NoopTracer.INSTANCE ); } diff --git a/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionIndicesThatCannotBeCreatedTests.java b/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionIndicesThatCannotBeCreatedTests.java index 9ef0f85893fc8..99c0cf9e837f8 100644 --- a/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionIndicesThatCannotBeCreatedTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionIndicesThatCannotBeCreatedTests.java @@ -54,6 +54,7 @@ import org.opensearch.index.VersionType; import org.opensearch.indices.SystemIndices; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.VersionUtils; import org.opensearch.threadpool.ThreadPool; @@ -154,7 +155,8 @@ private void indicesThatCannotBeCreatedTestCase( Settings.EMPTY, new ClusterService(Settings.EMPTY, new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), null) ), - new SystemIndices(emptyMap()) + new SystemIndices(emptyMap()), + NoopTracer.INSTANCE ) { @Override void executeBulk( diff --git a/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionIngestTests.java b/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionIngestTests.java index 5410d6a88a5b9..302644f6ce414 100644 --- a/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionIngestTests.java +++ b/server/src/test/java/org/opensearch/action/bulk/TransportBulkActionIngestTests.java @@ -70,6 +70,7 @@ import org.opensearch.indices.SystemIndices; import org.opensearch.ingest.IngestService; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.VersionUtils; import org.opensearch.threadpool.ThreadPool; @@ -171,7 +172,8 @@ class TestTransportBulkAction extends TransportBulkAction { SETTINGS, new ClusterService(SETTINGS, new ClusterSettings(SETTINGS, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), null) ), - new SystemIndices(emptyMap()) + new SystemIndices(emptyMap()), + NoopTracer.INSTANCE ); } @@ -208,7 +210,8 @@ class TestSingleItemBulkWriteAction extends TransportSingleItemBulkWriteAction listener) {} @@ -243,7 +244,8 @@ public void testTransportMultiGetAction() { clusterService, shardAction, new ActionFilters(emptySet()), - new Resolver() + new Resolver(), + NoopTracer.INSTANCE ) { @Override protected void executeShardAction( @@ -275,7 +277,8 @@ public void testTransportMultiGetAction_withMissingRouting() { clusterService, shardAction, new ActionFilters(emptySet()), - new Resolver() + new Resolver(), + NoopTracer.INSTANCE ) { @Override protected void executeShardAction( diff --git a/server/src/test/java/org/opensearch/action/main/MainActionTests.java b/server/src/test/java/org/opensearch/action/main/MainActionTests.java index b43dc2a80cd37..9f53dd1ddabe5 100644 --- a/server/src/test/java/org/opensearch/action/main/MainActionTests.java +++ b/server/src/test/java/org/opensearch/action/main/MainActionTests.java @@ -113,7 +113,13 @@ public void testMainActionClusterAvailable() { Collections.emptySet(), NoopTracer.INSTANCE ); - TransportMainAction action = new TransportMainAction(settings, transportService, mock(ActionFilters.class), clusterService); + TransportMainAction action = new TransportMainAction( + settings, + transportService, + mock(ActionFilters.class), + clusterService, + NoopTracer.INSTANCE + ); AtomicReference responseRef = new AtomicReference<>(); action.doExecute(mock(Task.class), new MainRequest(), new ActionListener() { @Override diff --git a/server/src/test/java/org/opensearch/action/resync/TransportResyncReplicationActionTests.java b/server/src/test/java/org/opensearch/action/resync/TransportResyncReplicationActionTests.java index fbac465f946f4..48e85ba6a5a03 100644 --- a/server/src/test/java/org/opensearch/action/resync/TransportResyncReplicationActionTests.java +++ b/server/src/test/java/org/opensearch/action/resync/TransportResyncReplicationActionTests.java @@ -202,7 +202,8 @@ public void testResyncDoesNotBlockOnPrimaryAction() throws Exception { shardStateAction, new ActionFilters(new HashSet<>()), new IndexingPressureService(Settings.EMPTY, clusterService), - new SystemIndices(emptyMap()) + new SystemIndices(emptyMap()), + NoopTracer.INSTANCE ); assertThat(action.globalBlockLevel(), nullValue()); @@ -255,7 +256,8 @@ private TransportResyncReplicationAction createAction() { mock(ShardStateAction.class), new ActionFilters(new HashSet<>()), mock(IndexingPressureService.class), - new SystemIndices(emptyMap()) + new SystemIndices(emptyMap()), + NoopTracer.INSTANCE ); } } diff --git a/server/src/test/java/org/opensearch/action/search/MultiSearchActionTookTests.java b/server/src/test/java/org/opensearch/action/search/MultiSearchActionTookTests.java index 94ba5b0a8768b..5723b185e214f 100644 --- a/server/src/test/java/org/opensearch/action/search/MultiSearchActionTookTests.java +++ b/server/src/test/java/org/opensearch/action/search/MultiSearchActionTookTests.java @@ -208,7 +208,8 @@ public String getLocalNodeId() { clusterService, availableProcessors, expected::get, - client + client, + NoopTracer.INSTANCE ) { @Override void executeSearch( @@ -230,7 +231,8 @@ void executeSearch( clusterService, availableProcessors, System::nanoTime, - client + client, + NoopTracer.INSTANCE ) { @Override void executeSearch( diff --git a/server/src/test/java/org/opensearch/action/search/TransportDeletePitActionTests.java b/server/src/test/java/org/opensearch/action/search/TransportDeletePitActionTests.java index 8d3cdc070c695..1bb18f1722b07 100644 --- a/server/src/test/java/org/opensearch/action/search/TransportDeletePitActionTests.java +++ b/server/src/test/java/org/opensearch/action/search/TransportDeletePitActionTests.java @@ -173,7 +173,8 @@ public Transport.Connection getConnection(String clusterAlias, DiscoveryNode nod transportService, actionFilters, namedWriteableRegistry, - pitService + pitService, + NoopTracer.INSTANCE ); DeletePitRequest deletePITRequest = new DeletePitRequest(pitId); PlainActionFuture future = newFuture(); @@ -248,7 +249,8 @@ public void getAllPits(ActionListener getAllPitsListener transportService, actionFilters, namedWriteableRegistry, - pitService + pitService, + NoopTracer.INSTANCE ); DeletePitRequest deletePITRequest = new DeletePitRequest("_all"); PlainActionFuture future = newFuture(); @@ -314,7 +316,8 @@ public Transport.Connection getConnection(String clusterAlias, DiscoveryNode nod transportService, actionFilters, namedWriteableRegistry, - pitService + pitService, + NoopTracer.INSTANCE ); DeletePitRequest deletePITRequest = new DeletePitRequest(pitId); PlainActionFuture future = newFuture(); @@ -370,7 +373,8 @@ public Transport.Connection getConnection(String clusterAlias, DiscoveryNode nod transportService, actionFilters, namedWriteableRegistry, - pitService + pitService, + NoopTracer.INSTANCE ); DeletePitRequest deletePITRequest = new DeletePitRequest(pitId); PlainActionFuture future = newFuture(); @@ -435,7 +439,8 @@ public Transport.Connection getConnection(String clusterAlias, DiscoveryNode nod transportService, actionFilters, namedWriteableRegistry, - pitService + pitService, + NoopTracer.INSTANCE ); DeletePitRequest deletePITRequest = new DeletePitRequest(pitId); PlainActionFuture future = newFuture(); @@ -512,7 +517,8 @@ public void getAllPits(ActionListener getAllPitsListener transportService, actionFilters, namedWriteableRegistry, - pitService + pitService, + NoopTracer.INSTANCE ); DeletePitRequest deletePITRequest = new DeletePitRequest("_all"); PlainActionFuture future = newFuture(); @@ -585,7 +591,8 @@ public void getAllPits(ActionListener getAllPitsListener transportService, actionFilters, namedWriteableRegistry, - pitService + pitService, + NoopTracer.INSTANCE ); DeletePitRequest deletePITRequest = new DeletePitRequest("_all"); PlainActionFuture future = newFuture(); @@ -662,7 +669,8 @@ public void getAllPits(ActionListener getAllPitsListener transportService, actionFilters, namedWriteableRegistry, - pitService + pitService, + NoopTracer.INSTANCE ); DeletePitRequest deletePITRequest = new DeletePitRequest("_all"); PlainActionFuture future = newFuture(); diff --git a/server/src/test/java/org/opensearch/action/search/TransportMultiSearchActionTests.java b/server/src/test/java/org/opensearch/action/search/TransportMultiSearchActionTests.java index 48970e2b96add..cce7b94052abf 100644 --- a/server/src/test/java/org/opensearch/action/search/TransportMultiSearchActionTests.java +++ b/server/src/test/java/org/opensearch/action/search/TransportMultiSearchActionTests.java @@ -128,7 +128,8 @@ public String getLocalNodeId() { clusterService, 10, System::nanoTime, - client + client, + NoopTracer.INSTANCE ); PlainActionFuture future = newFuture(); @@ -222,7 +223,8 @@ public String getLocalNodeId() { clusterService, 10, System::nanoTime, - client + client, + NoopTracer.INSTANCE ); // Execute the multi search api and fail if we find an error after executing: diff --git a/server/src/test/java/org/opensearch/action/support/TransportActionFilterChainTests.java b/server/src/test/java/org/opensearch/action/support/TransportActionFilterChainTests.java index a4f40db365f9a..c56a8fb35a7cf 100644 --- a/server/src/test/java/org/opensearch/action/support/TransportActionFilterChainTests.java +++ b/server/src/test/java/org/opensearch/action/support/TransportActionFilterChainTests.java @@ -43,6 +43,7 @@ import org.opensearch.node.Node; import org.opensearch.tasks.Task; import org.opensearch.tasks.TaskManager; +import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.ThreadPool; import org.junit.After; @@ -98,7 +99,8 @@ public void testActionFiltersRequest() throws InterruptedException { TransportAction transportAction = new TransportAction( actionName, actionFilters, - new TaskManager(Settings.EMPTY, threadPool, Collections.emptySet()) + new TaskManager(Settings.EMPTY, threadPool, Collections.emptySet()), + NoopTracer.INSTANCE ) { @Override protected void doExecute(Task task, TestRequest request, ActionListener listener) { @@ -183,7 +185,8 @@ public void exe TransportAction transportAction = new TransportAction( actionName, actionFilters, - new TaskManager(Settings.EMPTY, threadPool, Collections.emptySet()) + new TaskManager(Settings.EMPTY, threadPool, Collections.emptySet()), + NoopTracer.INSTANCE ) { @Override protected void doExecute(Task task, TestRequest request, ActionListener listener) { diff --git a/server/src/test/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java b/server/src/test/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java index 4305151965ab6..ad444b6431551 100644 --- a/server/src/test/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java +++ b/server/src/test/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java @@ -152,7 +152,8 @@ class TestTransportBroadcastByNodeAction extends TransportBroadcastByNodeAction< actionFilters, indexNameExpressionResolver, request, - executor + executor, + NoopTracer.INSTANCE ); } diff --git a/server/src/test/java/org/opensearch/action/support/clustermanager/TransportClusterManagerNodeActionTests.java b/server/src/test/java/org/opensearch/action/support/clustermanager/TransportClusterManagerNodeActionTests.java index 9ae1310a8b15c..a8b1f8d21f412 100644 --- a/server/src/test/java/org/opensearch/action/support/clustermanager/TransportClusterManagerNodeActionTests.java +++ b/server/src/test/java/org/opensearch/action/support/clustermanager/TransportClusterManagerNodeActionTests.java @@ -63,6 +63,7 @@ import org.opensearch.discovery.ClusterManagerNotDiscoveredException; import org.opensearch.node.NodeClosedException; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.transport.CapturingTransport; @@ -205,7 +206,7 @@ public void writeTo(StreamOutput out) throws IOException { } class Action extends TransportClusterManagerNodeAction { - Action(String actionName, TransportService transportService, ClusterService clusterService, ThreadPool threadPool) { + Action(String actionName, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, Tracer tracer) { super( actionName, transportService, @@ -213,7 +214,8 @@ class Action extends TransportClusterManagerNodeAction { threadPool, new ActionFilters(new HashSet<>()), Request::new, - new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY)) + new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY)), + tracer ); } @@ -256,7 +258,7 @@ public void testLocalOperationWithoutBlocks() throws ExecutionException, Interru setState(clusterService, ClusterStateCreationUtils.state(localNode, localNode, allNodes)); - new Action("internal:testAction", transportService, clusterService, threadPool) { + new Action("internal:testAction", transportService, clusterService, threadPool, NoopTracer.INSTANCE) { @Override protected void clusterManagerOperation(Task task, Request request, ClusterState state, ActionListener listener) { if (clusterManagerOperationFailure) { @@ -293,7 +295,7 @@ public void testDeprecatedMasterOperationWithTaskParameterCanBeCalled() throws E setState(clusterService, ClusterStateCreationUtils.state(localNode, localNode, allNodes)); - new Action("internal:testAction", transportService, clusterService, threadPool) { + new Action("internal:testAction", transportService, clusterService, threadPool, NoopTracer.INSTANCE) { @Override protected void masterOperation(Task task, Request request, ClusterState state, ActionListener listener) { if (clusterManagerOperationFailure) { @@ -330,7 +332,7 @@ public void testLocalOperationWithBlocks() throws ExecutionException, Interrupte .build(); setState(clusterService, stateWithBlock); - new Action("internal:testAction", transportService, clusterService, threadPool) { + new Action("internal:testAction", transportService, clusterService, threadPool, NoopTracer.INSTANCE) { @Override protected ClusterBlockException checkBlock(Request request, ClusterState state) { Set blocks = state.blocks().global(); @@ -376,7 +378,7 @@ public void testCheckBlockThrowsException() throws InterruptedException { .build(); setState(clusterService, stateWithBlock); - new Action("internal:testAction", transportService, clusterService, threadPool) { + new Action("internal:testAction", transportService, clusterService, threadPool, NoopTracer.INSTANCE) { @Override protected ClusterBlockException checkBlock(Request request, ClusterState state) { Set blocks = state.blocks().global(); @@ -408,7 +410,7 @@ public void testForceLocalOperation() throws ExecutionException, InterruptedExce setState(clusterService, ClusterStateCreationUtils.state(localNode, randomFrom(localNode, remoteNode, null), allNodes)); - new Action("internal:testAction", transportService, clusterService, threadPool) { + new Action("internal:testAction", transportService, clusterService, threadPool, NoopTracer.INSTANCE) { @Override protected boolean localExecute(Request request) { return true; @@ -423,7 +425,7 @@ public void testClusterManagerNotAvailable() throws ExecutionException, Interrup Request request = new Request().clusterManagerNodeTimeout(TimeValue.timeValueSeconds(0)); setState(clusterService, ClusterStateCreationUtils.state(localNode, null, allNodes)); PlainActionFuture listener = new PlainActionFuture<>(); - new Action("internal:testAction", transportService, clusterService, threadPool).execute(request, listener); + new Action("internal:testAction", transportService, clusterService, threadPool, NoopTracer.INSTANCE).execute(request, listener); assertTrue(listener.isDone()); assertListenerThrows("ClusterManagerNotDiscoveredException should be thrown", listener, ClusterManagerNotDiscoveredException.class); } @@ -432,7 +434,7 @@ public void testClusterManagerBecomesAvailable() throws ExecutionException, Inte Request request = new Request(); setState(clusterService, ClusterStateCreationUtils.state(localNode, null, allNodes)); PlainActionFuture listener = new PlainActionFuture<>(); - new Action("internal:testAction", transportService, clusterService, threadPool).execute(request, listener); + new Action("internal:testAction", transportService, clusterService, threadPool, NoopTracer.INSTANCE).execute(request, listener); assertFalse(listener.isDone()); setState(clusterService, ClusterStateCreationUtils.state(localNode, localNode, allNodes)); assertTrue(listener.isDone()); @@ -444,7 +446,7 @@ public void testDelegateToClusterManager() throws ExecutionException, Interrupte setState(clusterService, ClusterStateCreationUtils.state(localNode, remoteNode, allNodes)); PlainActionFuture listener = new PlainActionFuture<>(); - new Action("internal:testAction", transportService, clusterService, threadPool).execute(request, listener); + new Action("internal:testAction", transportService, clusterService, threadPool, NoopTracer.INSTANCE).execute(request, listener); assertThat(transport.capturedRequests().length, equalTo(1)); CapturingTransport.CapturedRequest capturedRequest = transport.capturedRequests()[0]; @@ -470,7 +472,7 @@ public void testDelegateToFailingClusterManager() throws ExecutionException, Int ); PlainActionFuture listener = new PlainActionFuture<>(); - new Action("internal:testAction", transportService, clusterService, threadPool).execute(request, listener); + new Action("internal:testAction", transportService, clusterService, threadPool, NoopTracer.INSTANCE).execute(request, listener); CapturingTransport.CapturedRequest[] capturedRequests = transport.getCapturedRequestsAndClear(); assertThat(capturedRequests.length, equalTo(1)); @@ -552,7 +554,7 @@ public void testClusterManagerFailoverAfterStepDown() throws ExecutionException, setState(clusterService, ClusterStateCreationUtils.state(localNode, localNode, allNodes)); - new Action("internal:testAction", transportService, clusterService, threadPool) { + new Action("internal:testAction", transportService, clusterService, threadPool, NoopTracer.INSTANCE) { @Override protected void clusterManagerOperation(Request request, ClusterState state, ActionListener listener) throws Exception { @@ -599,7 +601,7 @@ public void testDelegateToClusterManagerOnNodeWithDeprecatedMasterRole() throws setState(clusterService, ClusterStateCreationUtils.state(localNode, remoteNode, allNodes)); PlainActionFuture listener = new PlainActionFuture<>(); - new Action("internal:testAction", transportService, clusterService, threadPool).execute(request, listener); + new Action("internal:testAction", transportService, clusterService, threadPool, NoopTracer.INSTANCE).execute(request, listener); assertThat(transport.capturedRequests().length, equalTo(1)); CapturingTransport.CapturedRequest capturedRequest = transport.capturedRequests()[0]; @@ -621,7 +623,13 @@ public void testThrottlingRetryLocalMaster() throws InterruptedException, Broken CyclicBarrier barrier = new CyclicBarrier(2); setState(clusterService, ClusterStateCreationUtils.state(localNode, localNode, new DiscoveryNode[] { localNode })); - TransportClusterManagerNodeAction action = new Action("internal:testAction", transportService, clusterService, threadPool) { + TransportClusterManagerNodeAction action = new Action( + "internal:testAction", + transportService, + clusterService, + threadPool, + NoopTracer.INSTANCE + ) { @Override protected void masterOperation(Task task, Request request, ClusterState state, ActionListener listener) { if (exception.getAndSet(false)) { @@ -654,7 +662,13 @@ public void testThrottlingRetryRemoteMaster() throws ExecutionException, Interru ); PlainActionFuture listener = new PlainActionFuture<>(); - TransportClusterManagerNodeAction action = new Action("internal:testAction", transportService, clusterService, threadPool); + TransportClusterManagerNodeAction action = new Action( + "internal:testAction", + transportService, + clusterService, + threadPool, + NoopTracer.INSTANCE + ); action.execute(request, listener); CapturingTransport.CapturedRequest[] capturedRequests = transport.getCapturedRequestsAndClear(); @@ -692,7 +706,13 @@ public void testRetryForDifferentException() throws InterruptedException, Broken CyclicBarrier barrier = new CyclicBarrier(2); setState(clusterService, ClusterStateCreationUtils.state(localNode, localNode, new DiscoveryNode[] { localNode })); - TransportClusterManagerNodeAction action = new Action("internal:testAction", transportService, clusterService, threadPool) { + TransportClusterManagerNodeAction action = new Action( + "internal:testAction", + transportService, + clusterService, + threadPool, + NoopTracer.INSTANCE + ) { @Override protected void masterOperation(Task task, Request request, ClusterState state, ActionListener listener) throws Exception { diff --git a/server/src/test/java/org/opensearch/action/support/nodes/TransportNodesActionTests.java b/server/src/test/java/org/opensearch/action/support/nodes/TransportNodesActionTests.java index 445934b0ccdfd..aecae4c8cd79d 100644 --- a/server/src/test/java/org/opensearch/action/support/nodes/TransportNodesActionTests.java +++ b/server/src/test/java/org/opensearch/action/support/nodes/TransportNodesActionTests.java @@ -296,7 +296,8 @@ private static class TestTransportNodesAction extends TransportNodesAction< request, nodeRequest, nodeExecutor, - TestNodeResponse.class + TestNodeResponse.class, + NoopTracer.INSTANCE ); } diff --git a/server/src/test/java/org/opensearch/action/support/replication/BroadcastReplicationTests.java b/server/src/test/java/org/opensearch/action/support/replication/BroadcastReplicationTests.java index 77c9c64ad6611..690bc2316a32c 100644 --- a/server/src/test/java/org/opensearch/action/support/replication/BroadcastReplicationTests.java +++ b/server/src/test/java/org/opensearch/action/support/replication/BroadcastReplicationTests.java @@ -62,6 +62,7 @@ import org.opensearch.core.indices.breaker.NoneCircuitBreakerService; import org.opensearch.core.rest.RestStatus; import org.opensearch.tasks.Task; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.threadpool.TestThreadPool; @@ -136,7 +137,8 @@ public void setUp() throws Exception { transportService, new ActionFilters(new HashSet<>()), new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY)), - null + null, + NoopTracer.INSTANCE ); } @@ -269,7 +271,8 @@ private class TestBroadcastReplicationAction extends TransportBroadcastReplicati TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, - TransportReplicationAction action + TransportReplicationAction action, + Tracer tracer ) { super( "internal:test-broadcast-replication-action", @@ -278,7 +281,8 @@ private class TestBroadcastReplicationAction extends TransportBroadcastReplicati transportService, actionFilters, indexNameExpressionResolver, - action + action, + tracer ); } diff --git a/server/src/test/java/org/opensearch/action/support/replication/TransportReplicationActionTests.java b/server/src/test/java/org/opensearch/action/support/replication/TransportReplicationActionTests.java index 0bee99f4d5656..0255381d95f12 100644 --- a/server/src/test/java/org/opensearch/action/support/replication/TransportReplicationActionTests.java +++ b/server/src/test/java/org/opensearch/action/support/replication/TransportReplicationActionTests.java @@ -87,6 +87,7 @@ import org.opensearch.indices.IndexClosedException; import org.opensearch.indices.IndicesService; import org.opensearch.indices.cluster.ClusterStateChanges; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.transport.CapturingTransport; @@ -985,7 +986,8 @@ public void testSeqNoIsSetOnPrimary() { clusterService, shardStateAction, threadPool, - indicesService + indicesService, + NoopTracer.INSTANCE ); action.handlePrimaryRequest(concreteShardRequest, createTransportChannel(listener), null); @@ -1501,7 +1503,16 @@ private class TestAction extends TransportReplicationAction executedOnPrimary + SetOnce executedOnPrimary, + Tracer tracer ) { super( settings, @@ -485,7 +487,8 @@ private abstract class TestAction extends TransportReplicationAction()), Request::new, Request::new, - ThreadPool.Names.SAME + ThreadPool.Names.SAME, + tracer ); this.shardId = Objects.requireNonNull(shardId); this.primary = Objects.requireNonNull(primary); @@ -579,7 +582,8 @@ private class SinglePermitWithBlocksAction extends TestAction { shardId, primary, replica, - new SetOnce<>() + new SetOnce<>(), + NoopTracer.INSTANCE ); this.globalBlock = globalBlock; } @@ -647,7 +651,8 @@ private class AllPermitsThenBlockAction extends TestAction { shardId, primary, replica, - new SetOnce<>() + new SetOnce<>(), + NoopTracer.INSTANCE ); } diff --git a/server/src/test/java/org/opensearch/action/support/replication/TransportWriteActionForIndexingPressureTests.java b/server/src/test/java/org/opensearch/action/support/replication/TransportWriteActionForIndexingPressureTests.java index 4a2185d1558f7..582059d5ef1db 100644 --- a/server/src/test/java/org/opensearch/action/support/replication/TransportWriteActionForIndexingPressureTests.java +++ b/server/src/test/java/org/opensearch/action/support/replication/TransportWriteActionForIndexingPressureTests.java @@ -37,6 +37,7 @@ import org.opensearch.index.translog.Translog; import org.opensearch.indices.IndicesService; import org.opensearch.indices.SystemIndices; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.transport.CapturingTransport; @@ -137,7 +138,15 @@ public void testIndexingPressureOperationStartedForReplicaNode() { .build(); this.indexingPressureService = new IndexingPressureService(settings, clusterService); - TestAction action = new TestAction(settings, "internal:testAction", transportService, clusterService, shardStateAction, threadPool); + TestAction action = new TestAction( + settings, + "internal:testAction", + transportService, + clusterService, + shardStateAction, + threadPool, + NoopTracer.INSTANCE + ); action.handleReplicaRequest( new TransportReplicationAction.ConcreteReplicaRequest<>( @@ -169,7 +178,15 @@ public void testIndexingPressureOperationStartedForReplicaShard() { .build(); this.indexingPressureService = new IndexingPressureService(settings, clusterService); - TestAction action = new TestAction(settings, "internal:testAction", transportService, clusterService, shardStateAction, threadPool); + TestAction action = new TestAction( + settings, + "internal:testAction", + transportService, + clusterService, + shardStateAction, + threadPool, + NoopTracer.INSTANCE + ); action.handleReplicaRequest( new TransportReplicationAction.ConcreteReplicaRequest<>( @@ -210,7 +227,8 @@ public void testIndexingPressureOperationStartedForPrimaryNode() { transportService, clusterService, shardStateAction, - threadPool + threadPool, + NoopTracer.INSTANCE ); action.handlePrimaryRequest( @@ -249,7 +267,8 @@ public void testIndexingPressureOperationStartedForPrimaryShard() { transportService, clusterService, shardStateAction, - threadPool + threadPool, + NoopTracer.INSTANCE ); action.handlePrimaryRequest( @@ -285,7 +304,15 @@ public void testIndexingPressureOperationStartedForLocalPrimaryNode() { .build(); this.indexingPressureService = new IndexingPressureService(settings, clusterService); - TestAction action = new TestAction(settings, "internal:testAction", transportService, clusterService, shardStateAction, threadPool); + TestAction action = new TestAction( + settings, + "internal:testAction", + transportService, + clusterService, + shardStateAction, + threadPool, + NoopTracer.INSTANCE + ); action.handlePrimaryRequest( new TransportReplicationAction.ConcreteShardRequest<>( @@ -317,7 +344,15 @@ public void testIndexingPressureOperationStartedForLocalPrimaryShard() { .build(); this.indexingPressureService = new IndexingPressureService(settings, clusterService); - TestAction action = new TestAction(settings, "internal:testAction", transportService, clusterService, shardStateAction, threadPool); + TestAction action = new TestAction( + settings, + "internal:testAction", + transportService, + clusterService, + shardStateAction, + threadPool, + NoopTracer.INSTANCE + ); action.handlePrimaryRequest( new TransportReplicationAction.ConcreteShardRequest<>( @@ -376,7 +411,8 @@ protected TestAction( TransportService transportService, ClusterService clusterService, ShardStateAction shardStateAction, - ThreadPool threadPool + ThreadPool threadPool, + Tracer tracer ) { super( settings, @@ -392,7 +428,8 @@ protected TestAction( ignore -> ThreadPool.Names.SAME, false, TransportWriteActionForIndexingPressureTests.this.indexingPressureService, - new SystemIndices(emptyMap()) + new SystemIndices(emptyMap()), + tracer ); } diff --git a/server/src/test/java/org/opensearch/action/support/replication/TransportWriteActionTests.java b/server/src/test/java/org/opensearch/action/support/replication/TransportWriteActionTests.java index 9d2069ac16190..b4549f82230bf 100644 --- a/server/src/test/java/org/opensearch/action/support/replication/TransportWriteActionTests.java +++ b/server/src/test/java/org/opensearch/action/support/replication/TransportWriteActionTests.java @@ -477,7 +477,8 @@ protected TestAction(boolean withDocumentFailureOnPrimary, boolean withDocumentF ignore -> ThreadPool.Names.SAME, false, new IndexingPressureService(Settings.EMPTY, TransportWriteActionTests.this.clusterService), - new SystemIndices(emptyMap()) + new SystemIndices(emptyMap()), + NoopTracer.INSTANCE ); this.withDocumentFailureOnPrimary = withDocumentFailureOnPrimary; this.withDocumentFailureOnReplica = withDocumentFailureOnReplica; @@ -505,7 +506,8 @@ protected TestAction( ignore -> ThreadPool.Names.SAME, false, new IndexingPressureService(settings, clusterService), - new SystemIndices(emptyMap()) + new SystemIndices(emptyMap()), + NoopTracer.INSTANCE ); this.withDocumentFailureOnPrimary = false; this.withDocumentFailureOnReplica = false; diff --git a/server/src/test/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationActionTests.java b/server/src/test/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationActionTests.java index 118b4e596fc66..73468eba78557 100644 --- a/server/src/test/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationActionTests.java +++ b/server/src/test/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationActionTests.java @@ -129,7 +129,8 @@ class TestTransportInstanceSingleOperationAction extends TransportInstanceSingle transportService, actionFilters, indexNameExpressionResolver, - request + request, + NoopTracer.INSTANCE ); } diff --git a/server/src/test/java/org/opensearch/action/termvectors/TransportMultiTermVectorsActionTests.java b/server/src/test/java/org/opensearch/action/termvectors/TransportMultiTermVectorsActionTests.java index 0868421fe1d41..4ab1cc3ccec42 100644 --- a/server/src/test/java/org/opensearch/action/termvectors/TransportMultiTermVectorsActionTests.java +++ b/server/src/test/java/org/opensearch/action/termvectors/TransportMultiTermVectorsActionTests.java @@ -205,7 +205,8 @@ public TaskManager getTaskManager() { mock(IndicesService.class), threadPool, new ActionFilters(emptySet()), - new Resolver() + new Resolver(), + NoopTracer.INSTANCE ) { @Override protected void doExecute( @@ -239,7 +240,8 @@ public void testTransportMultiGetAction() { clusterService, shardAction, new ActionFilters(emptySet()), - new Resolver() + new Resolver(), + NoopTracer.INSTANCE ) { @Override protected void executeShardAction( @@ -271,7 +273,8 @@ public void testTransportMultiGetAction_withMissingRouting() { clusterService, shardAction, new ActionFilters(emptySet()), - new Resolver() + new Resolver(), + NoopTracer.INSTANCE ) { @Override protected void executeShardAction( diff --git a/server/src/test/java/org/opensearch/client/node/NodeClientHeadersTests.java b/server/src/test/java/org/opensearch/client/node/NodeClientHeadersTests.java index 176c94b01c878..a378431f56096 100644 --- a/server/src/test/java/org/opensearch/client/node/NodeClientHeadersTests.java +++ b/server/src/test/java/org/opensearch/client/node/NodeClientHeadersTests.java @@ -44,6 +44,7 @@ import org.opensearch.core.common.io.stream.NamedWriteableRegistry; import org.opensearch.tasks.Task; import org.opensearch.tasks.TaskManager; +import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.threadpool.ThreadPool; import java.util.Collections; @@ -76,7 +77,7 @@ private Actions(Settings settings, ThreadPool threadPool, ActionType[] action private static class InternalTransportAction extends TransportAction { private InternalTransportAction(Settings settings, String actionName, ThreadPool threadPool) { - super(actionName, EMPTY_FILTERS, new TaskManager(settings, threadPool, Collections.emptySet())); + super(actionName, EMPTY_FILTERS, new TaskManager(settings, threadPool, Collections.emptySet()), NoopTracer.INSTANCE); } @Override diff --git a/server/src/test/java/org/opensearch/cluster/action/shard/routing/weighted/get/TransportGetWeightedRoutingActionTests.java b/server/src/test/java/org/opensearch/cluster/action/shard/routing/weighted/get/TransportGetWeightedRoutingActionTests.java index 775d113f986ca..36455cfb78ec0 100644 --- a/server/src/test/java/org/opensearch/cluster/action/shard/routing/weighted/get/TransportGetWeightedRoutingActionTests.java +++ b/server/src/test/java/org/opensearch/cluster/action/shard/routing/weighted/get/TransportGetWeightedRoutingActionTests.java @@ -110,7 +110,8 @@ public void setUpService() { weightedRoutingService, threadPool, new ActionFilters(emptySet()), - mock(IndexNameExpressionResolver.class) + mock(IndexNameExpressionResolver.class), + NoopTracer.INSTANCE ); client = new NodeClient(Settings.EMPTY, threadPool); } diff --git a/server/src/test/java/org/opensearch/cluster/decommission/DecommissionControllerTests.java b/server/src/test/java/org/opensearch/cluster/decommission/DecommissionControllerTests.java index 627f31502a417..b7911d993b857 100644 --- a/server/src/test/java/org/opensearch/cluster/decommission/DecommissionControllerTests.java +++ b/server/src/test/java/org/opensearch/cluster/decommission/DecommissionControllerTests.java @@ -107,7 +107,8 @@ public void setTransportServiceAndDefaultClusterState() { clusterService, threadPool, new ActionFilters(emptySet()), - new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY)) + new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY)), + NoopTracer.INSTANCE ); // registers action new TransportClearVotingConfigExclusionsAction( @@ -115,7 +116,8 @@ public void setTransportServiceAndDefaultClusterState() { clusterService, threadPool, new ActionFilters(emptySet()), - new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY)) + new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY)), + NoopTracer.INSTANCE ); // registers action transportService.start(); diff --git a/server/src/test/java/org/opensearch/cluster/health/ClusterStateHealthTests.java b/server/src/test/java/org/opensearch/cluster/health/ClusterStateHealthTests.java index 795dc8a624e38..cadd2253e7bc4 100644 --- a/server/src/test/java/org/opensearch/cluster/health/ClusterStateHealthTests.java +++ b/server/src/test/java/org/opensearch/cluster/health/ClusterStateHealthTests.java @@ -179,7 +179,8 @@ public void testClusterHealthWaitsForClusterStateApplication() throws Interrupte new ActionFilters(new HashSet<>()), indexNameExpressionResolver, new AllocationService(null, new TestGatewayAllocator(), null, null, null), - null + null, + NoopTracer.INSTANCE ); PlainActionFuture listener = new PlainActionFuture<>(); action.execute(new ClusterHealthRequest().waitForGreenStatus(), listener); diff --git a/server/src/test/java/org/opensearch/extensions/ExtensionsManagerTests.java b/server/src/test/java/org/opensearch/extensions/ExtensionsManagerTests.java index 57883f1e5914a..3a37383c3dda2 100644 --- a/server/src/test/java/org/opensearch/extensions/ExtensionsManagerTests.java +++ b/server/src/test/java/org/opensearch/extensions/ExtensionsManagerTests.java @@ -774,7 +774,8 @@ public void testRegisterHandler() throws Exception { clusterService, settings, client, - identityService + identityService, + NoopTracer.INSTANCE ); verify(mockTransportService, times(9)).registerRequestHandler(anyString(), anyString(), anyBoolean(), anyBoolean(), any(), any()); @@ -892,7 +893,8 @@ private void initialize(ExtensionsManager extensionsManager) { clusterService, settings, client, - identityService + identityService, + NoopTracer.INSTANCE ); } } diff --git a/server/src/test/java/org/opensearch/extensions/action/ExtensionTransportActionsHandlerTests.java b/server/src/test/java/org/opensearch/extensions/action/ExtensionTransportActionsHandlerTests.java index 1dede94c68208..e72a6d0629f98 100644 --- a/server/src/test/java/org/opensearch/extensions/action/ExtensionTransportActionsHandlerTests.java +++ b/server/src/test/java/org/opensearch/extensions/action/ExtensionTransportActionsHandlerTests.java @@ -107,7 +107,8 @@ public void setup() throws Exception { transportService, client, mockActionModule, - null + null, + NoopTracer.INSTANCE ); } diff --git a/server/src/test/java/org/opensearch/extensions/rest/RestSendToExtensionActionTests.java b/server/src/test/java/org/opensearch/extensions/rest/RestSendToExtensionActionTests.java index 992e37b3f120a..1db14f0662bd7 100644 --- a/server/src/test/java/org/opensearch/extensions/rest/RestSendToExtensionActionTests.java +++ b/server/src/test/java/org/opensearch/extensions/rest/RestSendToExtensionActionTests.java @@ -384,7 +384,13 @@ public void testRestSendToExtensionWithNamedRouteCollidingWithDynamicTransportAc DynamicActionRegistry dynamicActionRegistry = actionModule.getDynamicActionRegistry(); ActionFilters emptyFilters = new ActionFilters(Collections.emptySet()); ExtensionAction testExtensionAction = new ExtensionAction("extensionId", "test:action/name"); - ExtensionTransportAction testExtensionTransportAction = new ExtensionTransportAction("test:action/name", emptyFilters, null, null); + ExtensionTransportAction testExtensionTransportAction = new ExtensionTransportAction( + "test:action/name", + emptyFilters, + null, + null, + NoopTracer.INSTANCE + ); assertNull(dynamicActionRegistry.get(testExtensionAction)); dynamicActionRegistry.registerDynamicAction(testExtensionAction, testExtensionTransportAction); diff --git a/server/src/test/java/org/opensearch/index/seqno/GlobalCheckpointSyncActionTests.java b/server/src/test/java/org/opensearch/index/seqno/GlobalCheckpointSyncActionTests.java index 8363ea3757a2b..e36826305f6a8 100644 --- a/server/src/test/java/org/opensearch/index/seqno/GlobalCheckpointSyncActionTests.java +++ b/server/src/test/java/org/opensearch/index/seqno/GlobalCheckpointSyncActionTests.java @@ -135,7 +135,8 @@ public void testTranslogSyncAfterGlobalCheckpointSync() throws Exception { indicesService, threadPool, shardStateAction, - new ActionFilters(Collections.emptySet()) + new ActionFilters(Collections.emptySet()), + NoopTracer.INSTANCE ); final GlobalCheckpointSyncAction.Request primaryRequest = new GlobalCheckpointSyncAction.Request(indexShard.shardId()); if (randomBoolean()) { @@ -178,7 +179,8 @@ private GlobalCheckpointSyncAction createAction() { indicesService, threadPool, shardStateAction, - new ActionFilters(Collections.emptySet()) + new ActionFilters(Collections.emptySet()), + NoopTracer.INSTANCE ); } diff --git a/server/src/test/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncActionTests.java b/server/src/test/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncActionTests.java index ed04d9a20f18e..086e62b60a270 100644 --- a/server/src/test/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncActionTests.java +++ b/server/src/test/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncActionTests.java @@ -125,7 +125,8 @@ public void testRetentionLeaseBackgroundSyncActionOnPrimary() throws Interrupted indicesService, threadPool, shardStateAction, - new ActionFilters(Collections.emptySet()) + new ActionFilters(Collections.emptySet()), + NoopTracer.INSTANCE ); final RetentionLeases retentionLeases = mock(RetentionLeases.class); final RetentionLeaseBackgroundSyncAction.Request request = new RetentionLeaseBackgroundSyncAction.Request( @@ -164,7 +165,8 @@ public void testRetentionLeaseBackgroundSyncActionOnReplica() throws WriteStateE indicesService, threadPool, shardStateAction, - new ActionFilters(Collections.emptySet()) + new ActionFilters(Collections.emptySet()), + NoopTracer.INSTANCE ); final RetentionLeases retentionLeases = mock(RetentionLeases.class); final RetentionLeaseBackgroundSyncAction.Request request = new RetentionLeaseBackgroundSyncAction.Request( @@ -206,7 +208,8 @@ public void testBlocks() { indicesService, threadPool, shardStateAction, - new ActionFilters(Collections.emptySet()) + new ActionFilters(Collections.emptySet()), + NoopTracer.INSTANCE ); assertNull(action.indexBlockLevel()); @@ -234,7 +237,8 @@ private RetentionLeaseBackgroundSyncAction createAction() { mock(IndicesService.class), threadPool, shardStateAction, - new ActionFilters(Collections.emptySet()) + new ActionFilters(Collections.emptySet()), + NoopTracer.INSTANCE ); } diff --git a/server/src/test/java/org/opensearch/index/seqno/RetentionLeaseSyncActionTests.java b/server/src/test/java/org/opensearch/index/seqno/RetentionLeaseSyncActionTests.java index d9bca55a208c2..63a9ac2f2e8ec 100644 --- a/server/src/test/java/org/opensearch/index/seqno/RetentionLeaseSyncActionTests.java +++ b/server/src/test/java/org/opensearch/index/seqno/RetentionLeaseSyncActionTests.java @@ -125,7 +125,8 @@ public void testRetentionLeaseSyncActionOnPrimary() { shardStateAction, new ActionFilters(Collections.emptySet()), new IndexingPressureService(Settings.EMPTY, clusterService), - new SystemIndices(emptyMap()) + new SystemIndices(emptyMap()), + NoopTracer.INSTANCE ); final RetentionLeases retentionLeases = mock(RetentionLeases.class); final RetentionLeaseSyncAction.Request request = new RetentionLeaseSyncAction.Request(indexShard.shardId(), retentionLeases); @@ -162,7 +163,8 @@ public void testRetentionLeaseSyncActionOnReplica() throws Exception { shardStateAction, new ActionFilters(Collections.emptySet()), new IndexingPressureService(Settings.EMPTY, clusterService), - new SystemIndices(emptyMap()) + new SystemIndices(emptyMap()), + NoopTracer.INSTANCE ); final RetentionLeases retentionLeases = mock(RetentionLeases.class); final RetentionLeaseSyncAction.Request request = new RetentionLeaseSyncAction.Request(indexShard.shardId(), retentionLeases); @@ -203,7 +205,8 @@ public void testBlocks() { shardStateAction, new ActionFilters(Collections.emptySet()), new IndexingPressureService(Settings.EMPTY, clusterService), - new SystemIndices(emptyMap()) + new SystemIndices(emptyMap()), + NoopTracer.INSTANCE ); assertNull(action.indexBlockLevel()); @@ -233,7 +236,8 @@ private RetentionLeaseSyncAction createAction() { shardStateAction, new ActionFilters(Collections.emptySet()), new IndexingPressureService(Settings.EMPTY, clusterService), - new SystemIndices(emptyMap()) + new SystemIndices(emptyMap()), + NoopTracer.INSTANCE ); } diff --git a/server/src/test/java/org/opensearch/indices/cluster/ClusterStateChanges.java b/server/src/test/java/org/opensearch/indices/cluster/ClusterStateChanges.java index dc4dca80ea110..5da824e264dc2 100644 --- a/server/src/test/java/org/opensearch/indices/cluster/ClusterStateChanges.java +++ b/server/src/test/java/org/opensearch/indices/cluster/ClusterStateChanges.java @@ -263,7 +263,8 @@ public IndexMetadata upgradeIndexMetadata(IndexMetadata indexMetadata, Version m indicesService, threadPool, null, - actionFilters + actionFilters, + NoopTracer.INSTANCE ); TransportVerifyShardIndexBlockAction transportVerifyShardIndexBlockAction = new TransportVerifyShardIndexBlockAction( SETTINGS, @@ -272,7 +273,8 @@ public IndexMetadata upgradeIndexMetadata(IndexMetadata indexMetadata, Version m indicesService, threadPool, null, - actionFilters + actionFilters, + NoopTracer.INSTANCE ); final SystemIndices systemIndices = new SystemIndices(emptyMap()); ShardLimitValidator shardLimitValidator = new ShardLimitValidator(SETTINGS, clusterService, systemIndices); @@ -324,7 +326,8 @@ public IndexMetadata upgradeIndexMetadata(IndexMetadata indexMetadata, Version m clusterSettings, actionFilters, indexNameExpressionResolver, - destructiveOperations + destructiveOperations, + NoopTracer.INSTANCE ); transportOpenIndexAction = new TransportOpenIndexAction( transportService, @@ -333,7 +336,8 @@ public IndexMetadata upgradeIndexMetadata(IndexMetadata indexMetadata, Version m indexStateService, actionFilters, indexNameExpressionResolver, - destructiveOperations + destructiveOperations, + NoopTracer.INSTANCE ); transportDeleteIndexAction = new TransportDeleteIndexAction( transportService, @@ -342,7 +346,8 @@ public IndexMetadata upgradeIndexMetadata(IndexMetadata indexMetadata, Version m deleteIndexService, actionFilters, indexNameExpressionResolver, - destructiveOperations + destructiveOperations, + NoopTracer.INSTANCE ); transportUpdateSettingsAction = new TransportUpdateSettingsAction( transportService, @@ -350,7 +355,8 @@ public IndexMetadata upgradeIndexMetadata(IndexMetadata indexMetadata, Version m threadPool, metadataUpdateSettingsService, actionFilters, - indexNameExpressionResolver + indexNameExpressionResolver, + NoopTracer.INSTANCE ); transportClusterRerouteAction = new TransportClusterRerouteAction( transportService, @@ -358,7 +364,9 @@ public IndexMetadata upgradeIndexMetadata(IndexMetadata indexMetadata, Version m threadPool, allocationService, actionFilters, - indexNameExpressionResolver + indexNameExpressionResolver, + NoopTracer.INSTANCE + ); transportCreateIndexAction = new TransportCreateIndexAction( transportService, @@ -366,7 +374,8 @@ public IndexMetadata upgradeIndexMetadata(IndexMetadata indexMetadata, Version m threadPool, createIndexService, actionFilters, - indexNameExpressionResolver + indexNameExpressionResolver, + NoopTracer.INSTANCE ); repositoriesService = new RepositoriesService( diff --git a/server/src/test/java/org/opensearch/indices/replication/checkpoint/PublishCheckpointActionTests.java b/server/src/test/java/org/opensearch/indices/replication/checkpoint/PublishCheckpointActionTests.java index 2cf006176022d..1a98faa04b904 100644 --- a/server/src/test/java/org/opensearch/indices/replication/checkpoint/PublishCheckpointActionTests.java +++ b/server/src/test/java/org/opensearch/indices/replication/checkpoint/PublishCheckpointActionTests.java @@ -104,7 +104,8 @@ public void testPublishCheckpointActionOnPrimary() { threadPool, shardStateAction, new ActionFilters(Collections.emptySet()), - mockTargetService + mockTargetService, + NoopTracer.INSTANCE ); final ReplicationCheckpoint checkpoint = new ReplicationCheckpoint(indexShard.shardId(), 1111, 11, 1, Codec.getDefault().getName()); @@ -139,7 +140,8 @@ public void testPublishCheckpointActionOnReplica() { threadPool, shardStateAction, new ActionFilters(Collections.emptySet()), - mockTargetService + mockTargetService, + NoopTracer.INSTANCE ); final ReplicationCheckpoint checkpoint = new ReplicationCheckpoint(indexShard.shardId(), 1111, 11, 1, Codec.getDefault().getName()); @@ -183,7 +185,8 @@ private PublishCheckpointAction createAction() { threadPool, shardStateAction, new ActionFilters(Collections.emptySet()), - mock(SegmentReplicationTargetService.class) + mock(SegmentReplicationTargetService.class), + NoopTracer.INSTANCE ); } diff --git a/server/src/test/java/org/opensearch/indices/settings/InternalOrPrivateSettingsPlugin.java b/server/src/test/java/org/opensearch/indices/settings/InternalOrPrivateSettingsPlugin.java index b990e64bf0f18..a631f3b9a28e9 100644 --- a/server/src/test/java/org/opensearch/indices/settings/InternalOrPrivateSettingsPlugin.java +++ b/server/src/test/java/org/opensearch/indices/settings/InternalOrPrivateSettingsPlugin.java @@ -54,6 +54,7 @@ import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.plugins.ActionPlugin; import org.opensearch.plugins.Plugin; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -149,7 +150,8 @@ public TransportUpdateInternalOrPrivateAction( final ClusterService clusterService, final ThreadPool threadPool, final ActionFilters actionFilters, - final IndexNameExpressionResolver indexNameExpressionResolver + final IndexNameExpressionResolver indexNameExpressionResolver, + final Tracer tracer ) { super( UpdateInternalOrPrivateAction.NAME, @@ -158,7 +160,8 @@ public TransportUpdateInternalOrPrivateAction( threadPool, actionFilters, UpdateInternalOrPrivateAction.Request::new, - indexNameExpressionResolver + indexNameExpressionResolver, + tracer ); } diff --git a/server/src/test/java/org/opensearch/persistent/TestPersistentTasksPlugin.java b/server/src/test/java/org/opensearch/persistent/TestPersistentTasksPlugin.java index 0a1893173e8a7..afe5675ec116d 100644 --- a/server/src/test/java/org/opensearch/persistent/TestPersistentTasksPlugin.java +++ b/server/src/test/java/org/opensearch/persistent/TestPersistentTasksPlugin.java @@ -73,6 +73,7 @@ import org.opensearch.plugins.ActionPlugin; import org.opensearch.plugins.PersistentTaskPlugin; import org.opensearch.plugins.Plugin; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -563,7 +564,12 @@ public static class TransportTestTaskAction extends TransportTasksAction< TestTaskResponse> { @Inject - public TransportTestTaskAction(ClusterService clusterService, TransportService transportService, ActionFilters actionFilters) { + public TransportTestTaskAction( + ClusterService clusterService, + TransportService transportService, + ActionFilters actionFilters, + Tracer tracer + ) { super( TestTaskAction.NAME, clusterService, @@ -572,7 +578,8 @@ public TransportTestTaskAction(ClusterService clusterService, TransportService t TestTasksRequest::new, TestTasksResponse::new, TestTaskResponse::new, - ThreadPool.Names.MANAGEMENT + ThreadPool.Names.MANAGEMENT, + tracer ); } diff --git a/server/src/test/java/org/opensearch/rest/action/admin/indices/RestValidateQueryActionTests.java b/server/src/test/java/org/opensearch/rest/action/admin/indices/RestValidateQueryActionTests.java index 3fb6764846da6..5edc95b10a4f1 100644 --- a/server/src/test/java/org/opensearch/rest/action/admin/indices/RestValidateQueryActionTests.java +++ b/server/src/test/java/org/opensearch/rest/action/admin/indices/RestValidateQueryActionTests.java @@ -50,6 +50,7 @@ import org.opensearch.search.AbstractSearchTestCase; import org.opensearch.tasks.Task; import org.opensearch.tasks.TaskManager; +import org.opensearch.telemetry.tracing.noop.NoopTracer; import org.opensearch.test.rest.FakeRestChannel; import org.opensearch.test.rest.FakeRestRequest; import org.opensearch.threadpool.TestThreadPool; @@ -98,7 +99,8 @@ public static void stubValidateQueryAction() { final TransportAction transportAction = new TransportAction<>( ValidateQueryAction.NAME, new ActionFilters(Collections.emptySet()), - taskManager + taskManager, + NoopTracer.INSTANCE ) { @Override protected void doExecute(Task task, ActionRequest request, ActionListener listener) {} diff --git a/server/src/test/java/org/opensearch/snapshots/SnapshotResiliencyTests.java b/server/src/test/java/org/opensearch/snapshots/SnapshotResiliencyTests.java index 3c31c979ce856..3ec065434e825 100644 --- a/server/src/test/java/org/opensearch/snapshots/SnapshotResiliencyTests.java +++ b/server/src/test/java/org/opensearch/snapshots/SnapshotResiliencyTests.java @@ -2008,7 +2008,8 @@ public void onFailure(final Exception e) { indexNameExpressionResolver, repositoriesService, transportService, - actionFilters + actionFilters, + NoopTracer.INSTANCE ); nodeEnv = new NodeEnvironment(settings, environment); final NamedXContentRegistry namedXContentRegistry = new NamedXContentRegistry(Collections.emptyList()); @@ -2120,7 +2121,8 @@ public void onFailure(final Exception e) { shardStateAction, actionFilters, new IndexingPressureService(settings, clusterService), - new SystemIndices(emptyMap()) + new SystemIndices(emptyMap()), + NoopTracer.INSTANCE ) ), new GlobalCheckpointSyncAction( @@ -2130,7 +2132,8 @@ public void onFailure(final Exception e) { indicesService, threadPool, shardStateAction, - actionFilters + actionFilters, + NoopTracer.INSTANCE ), RetentionLeaseSyncer.EMPTY, SegmentReplicationCheckpointPublisher.EMPTY, @@ -2162,7 +2165,8 @@ public void onFailure(final Exception e) { threadPool, metadataCreateIndexService, actionFilters, - indexNameExpressionResolver + indexNameExpressionResolver, + NoopTracer.INSTANCE ) ); final MappingUpdatedAction mappingUpdatedAction = new MappingUpdatedAction(settings, clusterSettings, clusterService); @@ -2186,7 +2190,8 @@ public void onFailure(final Exception e) { mock(ThreadPool.class) ), mock(RemoteStorePressureService.class), - new SystemIndices(emptyMap()) + new SystemIndices(emptyMap()), + NoopTracer.INSTANCE ); actions.put( BulkAction.INSTANCE, @@ -2209,7 +2214,8 @@ public void onFailure(final Exception e) { indexNameExpressionResolver, new AutoCreateIndex(settings, clusterSettings, indexNameExpressionResolver, new SystemIndices(emptyMap())), new IndexingPressureService(settings, clusterService), - new SystemIndices(emptyMap()) + new SystemIndices(emptyMap()), + NoopTracer.INSTANCE ) ); final RestoreService restoreService = new RestoreService( @@ -2238,7 +2244,8 @@ public void onFailure(final Exception e) { metadataMappingService, actionFilters, indexNameExpressionResolver, - new RequestValidators<>(Collections.emptyList()) + new RequestValidators<>(Collections.emptyList()), + NoopTracer.INSTANCE ) ); actions.put( @@ -2249,7 +2256,8 @@ public void onFailure(final Exception e) { threadPool, metadataMappingService, actionFilters, - indexNameExpressionResolver + indexNameExpressionResolver, + NoopTracer.INSTANCE ) ); final ResponseCollectorService responseCollectorService = new ResponseCollectorService(clusterService); @@ -2297,7 +2305,8 @@ public void onFailure(final Exception e) { namedWriteableRegistry, List.of(), client - ) + ), + NoopTracer.INSTANCE ) ); actions.put( @@ -2308,7 +2317,8 @@ public void onFailure(final Exception e) { threadPool, restoreService, actionFilters, - indexNameExpressionResolver + indexNameExpressionResolver, + NoopTracer.INSTANCE ) ); actions.put( @@ -2320,7 +2330,8 @@ public void onFailure(final Exception e) { new MetadataDeleteIndexService(settings, clusterService, allocationService), actionFilters, indexNameExpressionResolver, - new DestructiveOperations(settings, clusterSettings) + new DestructiveOperations(settings, clusterSettings), + NoopTracer.INSTANCE ) ); actions.put( @@ -2331,7 +2342,8 @@ public void onFailure(final Exception e) { repositoriesService, threadPool, actionFilters, - indexNameExpressionResolver + indexNameExpressionResolver, + NoopTracer.INSTANCE ) ); actions.put( @@ -2343,7 +2355,8 @@ public void onFailure(final Exception e) { snapshotsService, threadPool, actionFilters, - indexNameExpressionResolver + indexNameExpressionResolver, + NoopTracer.INSTANCE ) ); actions.put( @@ -2354,7 +2367,8 @@ public void onFailure(final Exception e) { threadPool, snapshotsService, actionFilters, - indexNameExpressionResolver + indexNameExpressionResolver, + NoopTracer.INSTANCE ) ); actions.put( @@ -2365,7 +2379,8 @@ public void onFailure(final Exception e) { threadPool, allocationService, actionFilters, - indexNameExpressionResolver + indexNameExpressionResolver, + NoopTracer.INSTANCE ) ); actions.put( @@ -2376,7 +2391,8 @@ public void onFailure(final Exception e) { threadPool, repositoriesService, actionFilters, - indexNameExpressionResolver + indexNameExpressionResolver, + NoopTracer.INSTANCE ) ); actions.put( @@ -2386,7 +2402,8 @@ public void onFailure(final Exception e) { clusterService, threadPool, actionFilters, - indexNameExpressionResolver + indexNameExpressionResolver, + NoopTracer.INSTANCE ) ); actions.put( @@ -2405,8 +2422,10 @@ public void onFailure(final Exception e) { actionFilters, nodeEnv, indicesService, - namedXContentRegistry - ) + namedXContentRegistry, + NoopTracer.INSTANCE + ), + NoopTracer.INSTANCE ) ); actions.put( @@ -2417,7 +2436,8 @@ public void onFailure(final Exception e) { threadPool, snapshotsService, actionFilters, - indexNameExpressionResolver + indexNameExpressionResolver, + NoopTracer.INSTANCE ) ); DynamicActionRegistry dynamicActionRegistry = new DynamicActionRegistry(); diff --git a/test/framework/src/main/java/org/opensearch/test/OpenSearchTestCase.java b/test/framework/src/main/java/org/opensearch/test/OpenSearchTestCase.java index 8490ee4fc39bc..d570afecdd487 100644 --- a/test/framework/src/main/java/org/opensearch/test/OpenSearchTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/OpenSearchTestCase.java @@ -130,6 +130,7 @@ import org.opensearch.search.MockSearchService; import org.opensearch.test.junit.listeners.LoggingListener; import org.opensearch.test.junit.listeners.ReproduceInfoPrinter; +import org.opensearch.test.telemetry.annotation.SkipTracingStrictValidationRule; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; import org.opensearch.transport.nio.MockNioTransportPlugin; @@ -218,6 +219,9 @@ public abstract class OpenSearchTestCase extends LuceneTestCase { private static final Collection nettyLoggedLeaks = new ArrayList<>(); private HeaderWarningAppender headerWarningAppender; + @Rule + public SkipTracingStrictValidationRule skipTracingStrictValidationRule = new SkipTracingStrictValidationRule(); + @AfterClass public static void resetPortCounter() { portGenerator.set(0); diff --git a/test/framework/src/main/java/org/opensearch/test/telemetry/annotation/SkipTracingStrictValidation.java b/test/framework/src/main/java/org/opensearch/test/telemetry/annotation/SkipTracingStrictValidation.java new file mode 100644 index 0000000000000..89b52f17472b8 --- /dev/null +++ b/test/framework/src/main/java/org/opensearch/test/telemetry/annotation/SkipTracingStrictValidation.java @@ -0,0 +1,29 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.test.telemetry.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Annotation to skip Tracing strict check in fatal scenarios like forced node drop etc. where spans can not even be closed + * in the failure and exception scenarios. This annotation should really be used in the fatal scenarios only. + */ + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface SkipTracingStrictValidation { + /** + * Users should define the reason for using this annotation. + * @return reason for skipping the validation. + */ + String reason(); +} diff --git a/test/framework/src/main/java/org/opensearch/test/telemetry/annotation/SkipTracingStrictValidationRule.java b/test/framework/src/main/java/org/opensearch/test/telemetry/annotation/SkipTracingStrictValidationRule.java new file mode 100644 index 0000000000000..98adb9dda1785 --- /dev/null +++ b/test/framework/src/main/java/org/opensearch/test/telemetry/annotation/SkipTracingStrictValidationRule.java @@ -0,0 +1,36 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.test.telemetry.annotation; + +import org.opensearch.test.telemetry.tracing.StrictCheckSpanProcessor; +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; + +/** + * Define the rule for Skipping Trace validation. + */ +public class SkipTracingStrictValidationRule extends TestWatcher { + + @Override + public void starting(Description description) { + SkipTracingStrictValidation annotation = description.getAnnotation(SkipTracingStrictValidation.class); + if (annotation != null) { + StrictCheckSpanProcessor.pauseStrictValidation(); + } + } + + @Override + public void finished(Description description) { + SkipTracingStrictValidation annotation = description.getAnnotation(SkipTracingStrictValidation.class); + if (annotation != null) { + StrictCheckSpanProcessor.resumeStrictValidation(); + } + } + +} diff --git a/test/telemetry/src/main/java/org/opensearch/test/telemetry/tracing/StrictCheckSpanProcessor.java b/test/telemetry/src/main/java/org/opensearch/test/telemetry/tracing/StrictCheckSpanProcessor.java index f7ebb3ee18a9b..d6d70417c46b8 100644 --- a/test/telemetry/src/main/java/org/opensearch/test/telemetry/tracing/StrictCheckSpanProcessor.java +++ b/test/telemetry/src/main/java/org/opensearch/test/telemetry/tracing/StrictCheckSpanProcessor.java @@ -17,6 +17,7 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; /** * Strict check span processor to validate the spans. @@ -28,10 +29,13 @@ public class StrictCheckSpanProcessor implements SpanProcessor { public StrictCheckSpanProcessor() {} private static Map spanMap = new ConcurrentHashMap<>(); + private final static AtomicBoolean enabled = new AtomicBoolean(true); @Override public void onStart(Span span) { - spanMap.put(span.getSpanId(), toMockSpanData(span)); + if (enabled.get() == true) { + spanMap.put(span.getSpanId(), toMockSpanData(span)); + } } @Override @@ -84,4 +88,22 @@ public static void validateTracingStateOnShutdown() { } } + + /** + * Pauses the strict validation check. + */ + public static void pauseStrictValidation() { + if (enabled.get() == true) { + enabled.set(false); + } + } + + /** + * Resumes the strict validation check. + */ + public static void resumeStrictValidation() { + if (enabled.get() == false) { + enabled.set(true); + } + } }