From bfba97ae932b1397b3389d7b14ccdec3860dbd2e Mon Sep 17 00:00:00 2001 From: Gagan Juneja Date: Thu, 5 Oct 2023 18:42:30 +0530 Subject: [PATCH] Add tracer to Transport (#3463) ### Description Add tracer to fix the breaking issue. ### Issues Resolved - #3462 ### Check List - [ ] New functionality includes testing - [ ] New functionality has been documented - [x] Commits are signed per the DCO using --signoff By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin). --------- Signed-off-by: Gagan Juneja Co-authored-by: Gagan Juneja --- .../opensearch/security/OpenSearchSecurityPlugin.java | 9 ++++++--- .../security/ssl/OpenSearchSecuritySSLPlugin.java | 6 ++++-- .../ssl/transport/SecuritySSLNettyTransport.java | 7 +++++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java b/src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java index 9f2f63e782..fd9590e04d 100644 --- a/src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java +++ b/src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java @@ -824,7 +824,8 @@ public Map> getTransports( PageCacheRecycler pageCacheRecycler, CircuitBreakerService circuitBreakerService, NamedWriteableRegistry namedWriteableRegistry, - NetworkService networkService + NetworkService networkService, + Tracer tracer ) { Map> transports = new HashMap>(); @@ -835,7 +836,8 @@ public Map> getTransports( pageCacheRecycler, circuitBreakerService, namedWriteableRegistry, - networkService + networkService, + tracer ); } @@ -853,7 +855,8 @@ public Map> getTransports( sks, evaluateSslExceptionHandler(), sharedGroupFactory, - SSLConfig + SSLConfig, + tracer ) ); } diff --git a/src/main/java/org/opensearch/security/ssl/OpenSearchSecuritySSLPlugin.java b/src/main/java/org/opensearch/security/ssl/OpenSearchSecuritySSLPlugin.java index bff2cf02d5..18ec7457e9 100644 --- a/src/main/java/org/opensearch/security/ssl/OpenSearchSecuritySSLPlugin.java +++ b/src/main/java/org/opensearch/security/ssl/OpenSearchSecuritySSLPlugin.java @@ -315,7 +315,8 @@ public Map> getTransports( PageCacheRecycler pageCacheRecycler, CircuitBreakerService circuitBreakerService, NamedWriteableRegistry namedWriteableRegistry, - NetworkService networkService + NetworkService networkService, + Tracer tracer ) { Map> transports = new HashMap>(); @@ -333,7 +334,8 @@ public Map> getTransports( sks, NOOP_SSL_EXCEPTION_HANDLER, sharedGroupFactory, - SSLConfig + SSLConfig, + tracer ) ); diff --git a/src/main/java/org/opensearch/security/ssl/transport/SecuritySSLNettyTransport.java b/src/main/java/org/opensearch/security/ssl/transport/SecuritySSLNettyTransport.java index ad4ebec1c5..7aeebdaf9f 100644 --- a/src/main/java/org/opensearch/security/ssl/transport/SecuritySSLNettyTransport.java +++ b/src/main/java/org/opensearch/security/ssl/transport/SecuritySSLNettyTransport.java @@ -59,6 +59,7 @@ import org.opensearch.security.ssl.util.SSLConfigConstants; import org.opensearch.security.ssl.util.SSLConnectionTestResult; import org.opensearch.security.ssl.util.SSLConnectionTestUtil; +import org.opensearch.telemetry.tracing.Tracer; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.SharedGroupFactory; import org.opensearch.transport.TcpChannel; @@ -82,7 +83,8 @@ public SecuritySSLNettyTransport( final SecurityKeyStore ossks, final SslExceptionHandler errorHandler, SharedGroupFactory sharedGroupFactory, - final SSLConfig SSLConfig + final SSLConfig SSLConfig, + final Tracer tracer ) { super( settings, @@ -92,7 +94,8 @@ public SecuritySSLNettyTransport( pageCacheRecycler, namedWriteableRegistry, circuitBreakerService, - sharedGroupFactory + sharedGroupFactory, + tracer ); this.ossks = ossks;