Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] Add Tracer after refactoring in https://github.com/opensearch-project/OpenSearch/pull/9415 #3348

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
import org.opensearch.security.user.User;
import org.opensearch.security.user.UserService;
import org.opensearch.tasks.Task;
import org.opensearch.telemetry.tracing.Tracer;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.RemoteClusterService;
import org.opensearch.transport.Transport;
Expand Down Expand Up @@ -842,7 +843,8 @@ public Map<String, Supplier<HttpServerTransport>> getHttpTransports(
NamedXContentRegistry xContentRegistry,
NetworkService networkService,
Dispatcher dispatcher,
ClusterSettings clusterSettings
ClusterSettings clusterSettings,
Tracer tracer
) {

if (SSLConfig.isSslOnlyMode()) {
Expand All @@ -855,7 +857,8 @@ public Map<String, Supplier<HttpServerTransport>> getHttpTransports(
xContentRegistry,
networkService,
dispatcher,
clusterSettings
clusterSettings,
tracer
);
}

Expand All @@ -880,7 +883,8 @@ public Map<String, Supplier<HttpServerTransport>> getHttpTransports(
xContentRegistry,
validatingDispatcher,
clusterSettings,
sharedGroupFactory
sharedGroupFactory,
tracer
);

return Collections.singletonMap("org.opensearch.security.http.SecurityHttpServerTransport", () -> odshst);
Expand All @@ -895,7 +899,8 @@ public Map<String, Supplier<HttpServerTransport>> getHttpTransports(
xContentRegistry,
dispatcher,
clusterSettings,
sharedGroupFactory
sharedGroupFactory,
tracer
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.opensearch.security.ssl.SslExceptionHandler;
import org.opensearch.security.ssl.http.netty.SecuritySSLNettyHttpServerTransport;
import org.opensearch.security.ssl.http.netty.ValidatingDispatcher;
import org.opensearch.telemetry.tracing.Tracer;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.SharedGroupFactory;

Expand All @@ -50,7 +51,8 @@ public SecurityHttpServerTransport(
final NamedXContentRegistry namedXContentRegistry,
final ValidatingDispatcher dispatcher,
final ClusterSettings clusterSettings,
SharedGroupFactory sharedGroupFactory
SharedGroupFactory sharedGroupFactory,
Tracer tracer
) {
super(
settings,
Expand All @@ -62,7 +64,8 @@ public SecurityHttpServerTransport(
dispatcher,
sslExceptionHandler,
clusterSettings,
sharedGroupFactory
sharedGroupFactory,
tracer
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.opensearch.core.xcontent.NamedXContentRegistry;
import org.opensearch.http.HttpHandlingSettings;
import org.opensearch.http.netty4.Netty4HttpServerTransport;
import org.opensearch.telemetry.tracing.Tracer;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.SharedGroupFactory;

Expand All @@ -49,9 +50,20 @@ public SecurityNonSslHttpServerTransport(
final NamedXContentRegistry namedXContentRegistry,
final Dispatcher dispatcher,
ClusterSettings clusterSettings,
SharedGroupFactory sharedGroupFactory
SharedGroupFactory sharedGroupFactory,
Tracer tracer
) {
super(settings, networkService, bigArrays, threadPool, namedXContentRegistry, dispatcher, clusterSettings, sharedGroupFactory);
super(
settings,
networkService,
bigArrays,
threadPool,
namedXContentRegistry,
dispatcher,
clusterSettings,
sharedGroupFactory,
tracer
);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
import org.opensearch.security.ssl.transport.SecuritySSLNettyTransport;
import org.opensearch.security.ssl.transport.SecuritySSLTransportInterceptor;
import org.opensearch.security.ssl.util.SSLConfigConstants;
import org.opensearch.telemetry.tracing.Tracer;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.SharedGroupFactory;
import org.opensearch.transport.Transport;
Expand Down Expand Up @@ -242,7 +243,8 @@ public Map<String, Supplier<HttpServerTransport>> getHttpTransports(
NamedXContentRegistry xContentRegistry,
NetworkService networkService,
Dispatcher dispatcher,
ClusterSettings clusterSettings
ClusterSettings clusterSettings,
Tracer tracer
) {

if (!client && httpSSLEnabled) {
Expand All @@ -264,7 +266,8 @@ public Map<String, Supplier<HttpServerTransport>> getHttpTransports(
validatingDispatcher,
NOOP_SSL_EXCEPTION_HANDLER,
clusterSettings,
sharedGroupFactory
sharedGroupFactory,
tracer
);

return Collections.singletonMap("org.opensearch.security.ssl.http.netty.SecuritySSLNettyHttpServerTransport", () -> sgsnht);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.opensearch.http.netty4.Netty4HttpServerTransport;
import org.opensearch.security.ssl.SecurityKeyStore;
import org.opensearch.security.ssl.SslExceptionHandler;
import org.opensearch.telemetry.tracing.Tracer;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.SharedGroupFactory;

Expand All @@ -53,9 +54,20 @@ public SecuritySSLNettyHttpServerTransport(
final ValidatingDispatcher dispatcher,
final SslExceptionHandler errorHandler,
ClusterSettings clusterSettings,
SharedGroupFactory sharedGroupFactory
SharedGroupFactory sharedGroupFactory,
Tracer tracer
) {
super(settings, networkService, bigArrays, threadPool, namedXContentRegistry, dispatcher, clusterSettings, sharedGroupFactory);
super(
settings,
networkService,
bigArrays,
threadPool,
namedXContentRegistry,
dispatcher,
clusterSettings,
sharedGroupFactory,
tracer
);
this.sks = sks;
this.errorHandler = errorHandler;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.opensearch.rest.RestChannel;
import org.opensearch.rest.RestRequest;
import org.opensearch.security.support.ConfigConstants;
import org.opensearch.telemetry.tracing.Tracer;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.SharedGroupFactory;

Expand Down Expand Up @@ -78,7 +79,8 @@ public Map<String, Supplier<HttpServerTransport>> getHttpTransports(
NamedXContentRegistry xContentRegistry,
NetworkService networkService,
Dispatcher dispatcher,
ClusterSettings clusterSettings
ClusterSettings clusterSettings,
Tracer tracer
) {

final UserInjectingDispatcher validatingDispatcher = new UserInjectingDispatcher(dispatcher);
Expand All @@ -92,7 +94,8 @@ public Map<String, Supplier<HttpServerTransport>> getHttpTransports(
xContentRegistry,
validatingDispatcher,
clusterSettings,
sharedGroupFactory
sharedGroupFactory,
tracer
)
);
}
Expand All @@ -107,9 +110,20 @@ public UserInjectingServerTransport(
final NamedXContentRegistry namedXContentRegistry,
final Dispatcher dispatcher,
ClusterSettings clusterSettings,
SharedGroupFactory sharedGroupFactory
SharedGroupFactory sharedGroupFactory,
Tracer tracer
) {
super(settings, networkService, bigArrays, threadPool, namedXContentRegistry, dispatcher, clusterSettings, sharedGroupFactory);
super(
settings,
networkService,
bigArrays,
threadPool,
namedXContentRegistry,
dispatcher,
clusterSettings,
sharedGroupFactory,
tracer
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.opensearch.security.support.Base64Helper;
import org.opensearch.security.support.ConfigConstants;
import org.opensearch.security.user.User;
import org.opensearch.telemetry.tracing.Tracer;
import org.opensearch.test.transport.MockTransport;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.Transport.Connection;
Expand Down Expand Up @@ -122,7 +123,8 @@ public void testSendRequestDecorate() {
TransportService.NOOP_TRANSPORT_INTERCEPTOR,
boundTransportAddress -> clusterService.state().nodes().get(SecurityInterceptor.class.getSimpleName()),
null,
emptySet()
emptySet(),
mock(Tracer.class)
);

// CS-SUPPRESS-SINGLE: RegexpSingleline Extensions manager used for creating a mock
Expand Down