From b4830c03936bc848806816740bad1b44343f5754 Mon Sep 17 00:00:00 2001 From: Mateusz Rzeszutek Date: Mon, 29 May 2023 12:10:36 +0200 Subject: [PATCH] Deprecate InetSocketAddressNetClientAttributesGetter and move its methods to the interface --- ...ocketAddressNetClientAttributesGetter.java | 35 ++-------- .../net/NetClientAttributesGetter.java | 68 +++++++++++++++++-- ...tAddressNetClientAttributesGetterTest.java | 46 ++++++------- .../instrumenter/InstrumenterBenchmark.java | 7 +- .../DubboNetClientAttributesGetter.java | 7 +- ...cheHttpAsyncClientNetAttributesGetter.java | 6 +- .../ApacheHttpClientNetAttributesGetter.java | 6 +- .../ArmeriaNetClientAttributesGetter.java | 6 +- .../AsyncHttpClientNetAttributesGetter.java | 6 +- .../v3_0/CassandraNetAttributesGetter.java | 6 +- .../v4_0/CassandraNetAttributesGetter.java | 6 +- .../v4_4/CassandraNetAttributesGetter.java | 6 +- .../v2_0/CouchbaseNetAttributesGetter.java | 6 +- ...icsearch6TransportNetAttributesGetter.java | 6 +- .../GrpcNetClientAttributesGetter.java | 6 +- .../jedis/v3_0/JedisNetAttributesGetter.java | 8 +-- .../jedis/v4_0/JedisNetAttributesGetter.java | 8 +-- .../v5_1/LettuceNetAttributesGetter.java | 6 +- .../NettyConnectNetAttributesGetter.java | 6 +- .../NettyNetClientAttributesGetter.java | 6 +- .../NettyConnectNetAttributesGetter.java | 6 +- .../NettyNetClientAttributesGetter.java | 6 +- .../client/NettySslNetAttributesGetter.java | 6 +- .../PlayWsClientNetAttributesGetter.java | 6 +- ...ReactorNettyNetClientAttributesGetter.java | 6 +- .../redisson/RedissonNetAttributesGetter.java | 6 +- 26 files changed, 163 insertions(+), 130 deletions(-) diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetClientAttributesGetter.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetClientAttributesGetter.java index a02cb48afb24..ee6c430959ab 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetClientAttributesGetter.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetClientAttributesGetter.java @@ -11,38 +11,17 @@ /** * Extractor of Network - * attributes from a {@link InetSocketAddress}. Most network libraries will provide access to a - * {@link InetSocketAddress} so this is a convenient alternative to {@link - * NetClientAttributesExtractor}. There is no meaning to implement both in the same instrumentation. + * attributes from a {@link InetSocketAddress}. + * + * @deprecated Use {@link NetClientAttributesGetter} and its {@link + * NetClientAttributesGetter#getPeerSocketAddress(Object, Object)} method instead. */ +@Deprecated public abstract class InetSocketAddressNetClientAttributesGetter implements NetClientAttributesGetter { - @Nullable - protected abstract InetSocketAddress getPeerSocketAddress( - REQUEST request, @Nullable RESPONSE response); - @Nullable @Override - public String getSockFamily(REQUEST request, @Nullable RESPONSE response) { - return InetSocketAddressUtil.getSockFamily(getPeerSocketAddress(request, response), null); - } - - @Override - @Nullable - public final String getSockPeerAddr(REQUEST request, @Nullable RESPONSE response) { - return InetSocketAddressUtil.getHostAddress(getPeerSocketAddress(request, response)); - } - - @Override - @Nullable - public String getSockPeerName(REQUEST request, @Nullable RESPONSE response) { - return InetSocketAddressUtil.getHostName(getPeerSocketAddress(request, response)); - } - - @Nullable - @Override - public Integer getSockPeerPort(REQUEST request, @Nullable RESPONSE response) { - return InetSocketAddressUtil.getPort(getPeerSocketAddress(request, response)); - } + public abstract InetSocketAddress getPeerSocketAddress( + REQUEST request, @Nullable RESPONSE response); } diff --git a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetClientAttributesGetter.java b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetClientAttributesGetter.java index d0df3bd95605..c81913642266 100644 --- a/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetClientAttributesGetter.java +++ b/instrumentation-api-semconv/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/net/NetClientAttributesGetter.java @@ -5,6 +5,7 @@ package io.opentelemetry.instrumentation.api.instrumenter.net; +import java.net.InetSocketAddress; import javax.annotation.Nullable; /** @@ -48,23 +49,82 @@ default String getProtocolVersion(REQUEST request, @Nullable RESPONSE response) @Nullable Integer getPeerPort(REQUEST request); + /** + * Returns an {@link InetSocketAddress} object representing the peer socket address. + * + *

Implementing this method is equivalent to implementing all four of {@link + * #getSockFamily(Object, Object)}, {@link #getSockPeerAddr(Object, Object)}, {@link + * #getSockPeerName(Object, Object)} and {@link #getSockPeerPort(Object, Object)}. + */ @Nullable - default String getSockFamily(REQUEST request, @Nullable RESPONSE response) { + default InetSocketAddress getPeerSocketAddress(REQUEST request, @Nullable RESPONSE response) { return null; } + /** + * Returns the protocol address family which + * is used for communication. + * + *

Examples: {@code inet}, {@code inet6} + * + *

By default, this method attempts to retrieve the address family using the {@link + * #getPeerSocketAddress(Object, Object)} method. If it is not implemented, it will simply return + * {@code null}. If the instrumented library does not expose {@link InetSocketAddress} in its API, + * you might want to implement this method instead of {@link #getPeerSocketAddress(Object, + * Object)}. + */ + @Nullable + default String getSockFamily(REQUEST request, @Nullable RESPONSE response) { + return InetSocketAddressUtil.getSockFamily(getPeerSocketAddress(request, response), null); + } + + /** + * Returns the remote socket peer address: IPv4 or IPv6 for internet protocols, path for local + * communication, etc. + * + *

Examples: {@code 127.0.0.1}, {@code /tmp/mysql.sock} + * + *

By default, this method attempts to retrieve the peer address using the {@link + * #getPeerSocketAddress(Object, Object)} method. If this method is not implemented, it will + * simply return {@code null}. If the instrumented library does not expose {@link + * InetSocketAddress} in its API, you might want to implement this method instead of {@link + * #getPeerSocketAddress(Object, Object)}. + */ @Nullable default String getSockPeerAddr(REQUEST request, @Nullable RESPONSE response) { - return null; + return InetSocketAddressUtil.getHostAddress(getPeerSocketAddress(request, response)); } + /** + * Returns the domain name of an immediate peer. + * + *

Examples: {@code proxy.example.com} + * + *

By default, this method attempts to retrieve the peer host name using the {@link + * #getPeerSocketAddress(Object, Object)} method. If this method is not implemented, it will + * simply return {@code null}. If the instrumented library does not expose {@link + * InetSocketAddress} in its API, you might want to implement this method instead of {@link + * #getPeerSocketAddress(Object, Object)}. + */ @Nullable default String getSockPeerName(REQUEST request, @Nullable RESPONSE response) { - return null; + return InetSocketAddressUtil.getHostName(getPeerSocketAddress(request, response)); } + /** + * Returns the remote socket peer port. + * + *

Examples: {@code 16456} + * + *

By default, this method attempts to retrieve the peer port using the {@link + * #getPeerSocketAddress(Object, Object)} method. If this method is not implemented, it will + * simply return {@code null}. If the instrumented library does not expose {@link + * InetSocketAddress} in its API, you might want to implement this method instead of {@link + * #getPeerSocketAddress(Object, Object)}. + */ @Nullable default Integer getSockPeerPort(REQUEST request, @Nullable RESPONSE response) { - return null; + return InetSocketAddressUtil.getPort(getPeerSocketAddress(request, response)); } } diff --git a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetClientAttributesGetterTest.java b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetClientAttributesGetterTest.java index 7eac409ad9c3..2762d83c1f6a 100644 --- a/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetClientAttributesGetterTest.java +++ b/instrumentation-api-semconv/src/test/java/io/opentelemetry/instrumentation/api/instrumenter/net/InetSocketAddressNetClientAttributesGetterTest.java @@ -21,30 +21,30 @@ @ExtendWith(MockitoExtension.class) class InetSocketAddressNetClientAttributesGetterTest { - private final InetSocketAddressNetClientAttributesGetter - getter = - new InetSocketAddressNetClientAttributesGetter() { - - @Override - public String getPeerName(InetSocketAddress request) { - // net.peer.name and net.peer.port are tested in NetClientAttributesExtractorTest - return null; - } - - @Override - public Integer getPeerPort(InetSocketAddress request) { - // net.peer.name and net.peer.port are tested in NetClientAttributesExtractorTest - return null; - } - - @Override - protected InetSocketAddress getPeerSocketAddress( - InetSocketAddress request, InetSocketAddress response) { - return response; - } - }; + static class TestNetClientAttributesGetter + implements NetClientAttributesGetter { + + @Override + public String getPeerName(InetSocketAddress request) { + // net.peer.name and net.peer.port are tested in NetClientAttributesExtractorTest + return null; + } + + @Override + public Integer getPeerPort(InetSocketAddress request) { + // net.peer.name and net.peer.port are tested in NetClientAttributesExtractorTest + return null; + } + + @Override + public InetSocketAddress getPeerSocketAddress( + InetSocketAddress request, InetSocketAddress response) { + return response; + } + } + private final AttributesExtractor extractor = - NetClientAttributesExtractor.create(getter); + NetClientAttributesExtractor.create(new TestNetClientAttributesGetter()); @Test void noInetSocketAddress() { diff --git a/instrumentation-api/src/jmh/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBenchmark.java b/instrumentation-api/src/jmh/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBenchmark.java index f8bb2c5862e2..4e7e2c95b5b8 100644 --- a/instrumentation-api/src/jmh/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBenchmark.java +++ b/instrumentation-api/src/jmh/java/io/opentelemetry/instrumentation/api/instrumenter/InstrumenterBenchmark.java @@ -10,7 +10,7 @@ import io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientAttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientAttributesGetter; import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanNameExtractor; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import java.net.InetSocketAddress; import java.util.Collections; import java.util.List; @@ -88,8 +88,7 @@ public List getResponseHeader(Void unused, Void unused2, String name) { } } - static class ConstantNetAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + static class ConstantNetAttributesGetter implements NetClientAttributesGetter { private static final InetSocketAddress PEER_ADDRESS = InetSocketAddress.createUnresolved("localhost", 8080); @@ -120,7 +119,7 @@ public Integer getPeerPort(Void request) { @Nullable @Override - protected InetSocketAddress getPeerSocketAddress(Void request, @Nullable Void response) { + public InetSocketAddress getPeerSocketAddress(Void request, @Nullable Void response) { return PEER_ADDRESS; } } diff --git a/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/internal/DubboNetClientAttributesGetter.java b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/internal/DubboNetClientAttributesGetter.java index 262d42830aa6..391c966a24ab 100644 --- a/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/internal/DubboNetClientAttributesGetter.java +++ b/instrumentation/apache-dubbo-2.7/library-autoconfigure/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/internal/DubboNetClientAttributesGetter.java @@ -6,7 +6,7 @@ package io.opentelemetry.instrumentation.apachedubbo.v2_7.internal; import io.opentelemetry.instrumentation.apachedubbo.v2_7.DubboRequest; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import java.net.InetSocketAddress; import javax.annotation.Nullable; import org.apache.dubbo.rpc.Result; @@ -16,7 +16,7 @@ * any time. */ public final class DubboNetClientAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Nullable @Override @@ -31,8 +31,7 @@ public Integer getPeerPort(DubboRequest request) { @Override @Nullable - protected InetSocketAddress getPeerSocketAddress( - DubboRequest request, @Nullable Result response) { + public InetSocketAddress getPeerSocketAddress(DubboRequest request, @Nullable Result response) { return request.remoteAddress(); } } diff --git a/instrumentation/apache-httpasyncclient-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpasyncclient/ApacheHttpAsyncClientNetAttributesGetter.java b/instrumentation/apache-httpasyncclient-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpasyncclient/ApacheHttpAsyncClientNetAttributesGetter.java index 9021d7997e84..4ddfa61c5f3c 100644 --- a/instrumentation/apache-httpasyncclient-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpasyncclient/ApacheHttpAsyncClientNetAttributesGetter.java +++ b/instrumentation/apache-httpasyncclient-4.1/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpasyncclient/ApacheHttpAsyncClientNetAttributesGetter.java @@ -5,13 +5,13 @@ package io.opentelemetry.javaagent.instrumentation.apachehttpasyncclient; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import java.net.InetSocketAddress; import javax.annotation.Nullable; import org.apache.http.HttpResponse; final class ApacheHttpAsyncClientNetAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Override public String getProtocolName(ApacheHttpClientRequest request, @Nullable HttpResponse response) { @@ -37,7 +37,7 @@ public Integer getPeerPort(ApacheHttpClientRequest request) { @Nullable @Override - protected InetSocketAddress getPeerSocketAddress( + public InetSocketAddress getPeerSocketAddress( ApacheHttpClientRequest request, @Nullable HttpResponse response) { return request.peerSocketAddress(); } diff --git a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientNetAttributesGetter.java b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientNetAttributesGetter.java index cbb0cc2e4d96..04d66a5bb40e 100644 --- a/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientNetAttributesGetter.java +++ b/instrumentation/apache-httpclient/apache-httpclient-4.3/library/src/main/java/io/opentelemetry/instrumentation/apachehttpclient/v4_3/ApacheHttpClientNetAttributesGetter.java @@ -5,13 +5,13 @@ package io.opentelemetry.instrumentation.apachehttpclient.v4_3; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import java.net.InetSocketAddress; import javax.annotation.Nullable; import org.apache.http.HttpResponse; final class ApacheHttpClientNetAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Override public String getProtocolName(ApacheHttpClientRequest request, @Nullable HttpResponse response) { @@ -38,7 +38,7 @@ public Integer getPeerPort(ApacheHttpClientRequest request) { @Nullable @Override - protected InetSocketAddress getPeerSocketAddress( + public InetSocketAddress getPeerSocketAddress( ApacheHttpClientRequest request, @Nullable HttpResponse response) { return request.peerSocketAddress(); } diff --git a/instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/internal/ArmeriaNetClientAttributesGetter.java b/instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/internal/ArmeriaNetClientAttributesGetter.java index 22349240b0af..2e86e6ecc110 100644 --- a/instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/internal/ArmeriaNetClientAttributesGetter.java +++ b/instrumentation/armeria-1.3/library/src/main/java/io/opentelemetry/instrumentation/armeria/v1_3/internal/ArmeriaNetClientAttributesGetter.java @@ -9,7 +9,7 @@ import com.linecorp.armeria.common.RequestContext; import com.linecorp.armeria.common.SessionProtocol; import com.linecorp.armeria.common.logging.RequestLog; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import java.net.InetSocketAddress; import java.net.SocketAddress; import javax.annotation.Nullable; @@ -19,7 +19,7 @@ * any time. */ public final class ArmeriaNetClientAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Override public String getProtocolName(RequestContext ctx, @Nullable RequestLog requestLog) { @@ -65,7 +65,7 @@ public Integer getPeerPort(RequestContext ctx) { @Override @Nullable - protected InetSocketAddress getPeerSocketAddress( + public InetSocketAddress getPeerSocketAddress( RequestContext ctx, @Nullable RequestLog requestLog) { SocketAddress address = ctx.remoteAddress(); if (address instanceof InetSocketAddress) { diff --git a/instrumentation/async-http-client/async-http-client-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientNetAttributesGetter.java b/instrumentation/async-http-client/async-http-client-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientNetAttributesGetter.java index 75bcad45eae8..d6fc4638da51 100644 --- a/instrumentation/async-http-client/async-http-client-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientNetAttributesGetter.java +++ b/instrumentation/async-http-client/async-http-client-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/asynchttpclient/v2_0/AsyncHttpClientNetAttributesGetter.java @@ -7,14 +7,14 @@ import io.netty.handler.codec.http.HttpRequest; import io.netty.handler.codec.http.HttpVersion; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import java.net.InetSocketAddress; import javax.annotation.Nullable; import org.asynchttpclient.Response; import org.asynchttpclient.netty.request.NettyRequest; final class AsyncHttpClientNetAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Nullable @Override @@ -62,7 +62,7 @@ public Integer getPeerPort(RequestContext request) { @Override @Nullable - protected InetSocketAddress getPeerSocketAddress( + public InetSocketAddress getPeerSocketAddress( RequestContext request, @Nullable Response response) { if (response != null && response.getRemoteAddress() instanceof InetSocketAddress) { return (InetSocketAddress) response.getRemoteAddress(); diff --git a/instrumentation/cassandra/cassandra-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v3_0/CassandraNetAttributesGetter.java b/instrumentation/cassandra/cassandra-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v3_0/CassandraNetAttributesGetter.java index 0b0903278c9e..a092ab4ee2fd 100644 --- a/instrumentation/cassandra/cassandra-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v3_0/CassandraNetAttributesGetter.java +++ b/instrumentation/cassandra/cassandra-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v3_0/CassandraNetAttributesGetter.java @@ -6,12 +6,12 @@ package io.opentelemetry.javaagent.instrumentation.cassandra.v3_0; import com.datastax.driver.core.ExecutionInfo; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import java.net.InetSocketAddress; import javax.annotation.Nullable; final class CassandraNetAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Nullable @Override @@ -27,7 +27,7 @@ public Integer getPeerPort(CassandraRequest request) { @Override @Nullable - protected InetSocketAddress getPeerSocketAddress( + public InetSocketAddress getPeerSocketAddress( CassandraRequest request, @Nullable ExecutionInfo executionInfo) { return executionInfo == null ? null : executionInfo.getQueriedHost().getSocketAddress(); } diff --git a/instrumentation/cassandra/cassandra-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v4_0/CassandraNetAttributesGetter.java b/instrumentation/cassandra/cassandra-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v4_0/CassandraNetAttributesGetter.java index 4afc39a9758a..7650be823b5c 100644 --- a/instrumentation/cassandra/cassandra-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v4_0/CassandraNetAttributesGetter.java +++ b/instrumentation/cassandra/cassandra-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/cassandra/v4_0/CassandraNetAttributesGetter.java @@ -7,13 +7,13 @@ import com.datastax.oss.driver.api.core.cql.ExecutionInfo; import com.datastax.oss.driver.api.core.metadata.Node; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import java.net.InetSocketAddress; import java.net.SocketAddress; import javax.annotation.Nullable; final class CassandraNetAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Nullable @Override @@ -29,7 +29,7 @@ public Integer getPeerPort(CassandraRequest request) { @Override @Nullable - protected InetSocketAddress getPeerSocketAddress( + public InetSocketAddress getPeerSocketAddress( CassandraRequest request, @Nullable ExecutionInfo executionInfo) { if (executionInfo == null) { return null; diff --git a/instrumentation/cassandra/cassandra-4.4/library/src/main/java/io/opentelemetry/instrumentation/cassandra/v4_4/CassandraNetAttributesGetter.java b/instrumentation/cassandra/cassandra-4.4/library/src/main/java/io/opentelemetry/instrumentation/cassandra/v4_4/CassandraNetAttributesGetter.java index c497a86fa383..20b525769896 100644 --- a/instrumentation/cassandra/cassandra-4.4/library/src/main/java/io/opentelemetry/instrumentation/cassandra/v4_4/CassandraNetAttributesGetter.java +++ b/instrumentation/cassandra/cassandra-4.4/library/src/main/java/io/opentelemetry/instrumentation/cassandra/v4_4/CassandraNetAttributesGetter.java @@ -7,13 +7,13 @@ import com.datastax.oss.driver.api.core.cql.ExecutionInfo; import com.datastax.oss.driver.api.core.metadata.Node; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import java.net.InetSocketAddress; import java.net.SocketAddress; import javax.annotation.Nullable; final class CassandraNetAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Nullable @Override @@ -29,7 +29,7 @@ public Integer getPeerPort(CassandraRequest request) { @Override @Nullable - protected InetSocketAddress getPeerSocketAddress( + public InetSocketAddress getPeerSocketAddress( CassandraRequest request, @Nullable ExecutionInfo executionInfo) { if (executionInfo == null) { return null; diff --git a/instrumentation/couchbase/couchbase-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v2_0/CouchbaseNetAttributesGetter.java b/instrumentation/couchbase/couchbase-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v2_0/CouchbaseNetAttributesGetter.java index 3b2aedb204b5..20f88fe58843 100644 --- a/instrumentation/couchbase/couchbase-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v2_0/CouchbaseNetAttributesGetter.java +++ b/instrumentation/couchbase/couchbase-2.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/couchbase/v2_0/CouchbaseNetAttributesGetter.java @@ -5,13 +5,13 @@ package io.opentelemetry.javaagent.instrumentation.couchbase.v2_0; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import java.net.InetSocketAddress; import java.net.SocketAddress; import javax.annotation.Nullable; public class CouchbaseNetAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Nullable @Override @@ -27,7 +27,7 @@ public Integer getPeerPort(CouchbaseRequestInfo couchbaseRequest) { @Nullable @Override - protected InetSocketAddress getPeerSocketAddress( + public InetSocketAddress getPeerSocketAddress( CouchbaseRequestInfo couchbaseRequest, @Nullable Void unused) { SocketAddress peerAddress = couchbaseRequest.getPeerAddress(); if (peerAddress instanceof InetSocketAddress) { diff --git a/instrumentation/elasticsearch/elasticsearch-transport-6.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/v6_0/Elasticsearch6TransportNetAttributesGetter.java b/instrumentation/elasticsearch/elasticsearch-transport-6.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/v6_0/Elasticsearch6TransportNetAttributesGetter.java index bb8d058dcf21..12d2d614bd58 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-6.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/v6_0/Elasticsearch6TransportNetAttributesGetter.java +++ b/instrumentation/elasticsearch/elasticsearch-transport-6.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/v6_0/Elasticsearch6TransportNetAttributesGetter.java @@ -5,14 +5,14 @@ package io.opentelemetry.javaagent.instrumentation.elasticsearch.transport.v6_0; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import io.opentelemetry.javaagent.instrumentation.elasticsearch.transport.ElasticTransportRequest; import java.net.InetSocketAddress; import javax.annotation.Nullable; import org.elasticsearch.action.ActionResponse; public class Elasticsearch6TransportNetAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Nullable @Override @@ -28,7 +28,7 @@ public Integer getPeerPort(ElasticTransportRequest request) { @Override @Nullable - protected InetSocketAddress getPeerSocketAddress( + public InetSocketAddress getPeerSocketAddress( ElasticTransportRequest request, @Nullable ActionResponse response) { if (response != null && response.remoteAddress() != null) { return response.remoteAddress().address(); diff --git a/instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/internal/GrpcNetClientAttributesGetter.java b/instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/internal/GrpcNetClientAttributesGetter.java index c21f5bb845ab..079371e4b016 100644 --- a/instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/internal/GrpcNetClientAttributesGetter.java +++ b/instrumentation/grpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/internal/GrpcNetClientAttributesGetter.java @@ -6,7 +6,7 @@ package io.opentelemetry.instrumentation.grpc.v1_6.internal; import io.grpc.Status; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import io.opentelemetry.instrumentation.grpc.v1_6.GrpcRequest; import java.net.InetSocketAddress; import java.net.SocketAddress; @@ -17,7 +17,7 @@ * any time. */ public final class GrpcNetClientAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Nullable @Override @@ -32,7 +32,7 @@ public Integer getPeerPort(GrpcRequest grpcRequest) { @Override @Nullable - protected InetSocketAddress getPeerSocketAddress(GrpcRequest request, @Nullable Status response) { + public InetSocketAddress getPeerSocketAddress(GrpcRequest request, @Nullable Status response) { SocketAddress address = request.getPeerSocketAddress(); if (address instanceof InetSocketAddress) { return (InetSocketAddress) address; diff --git a/instrumentation/jedis/jedis-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/JedisNetAttributesGetter.java b/instrumentation/jedis/jedis-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/JedisNetAttributesGetter.java index 0298ab594260..510c27df3227 100644 --- a/instrumentation/jedis/jedis-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/JedisNetAttributesGetter.java +++ b/instrumentation/jedis/jedis-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v3_0/JedisNetAttributesGetter.java @@ -5,13 +5,12 @@ package io.opentelemetry.javaagent.instrumentation.jedis.v3_0; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import java.net.InetSocketAddress; import java.net.Socket; import javax.annotation.Nullable; -final class JedisNetAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { +final class JedisNetAttributesGetter implements NetClientAttributesGetter { @Nullable @Override @@ -26,8 +25,7 @@ public Integer getPeerPort(JedisRequest jedisRequest) { @Override @Nullable - protected InetSocketAddress getPeerSocketAddress( - JedisRequest jedisRequest, @Nullable Void unused) { + public InetSocketAddress getPeerSocketAddress(JedisRequest jedisRequest, @Nullable Void unused) { Socket socket = jedisRequest.getConnection().getSocket(); if (socket != null && socket.getRemoteSocketAddress() instanceof InetSocketAddress) { return (InetSocketAddress) socket.getRemoteSocketAddress(); diff --git a/instrumentation/jedis/jedis-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/JedisNetAttributesGetter.java b/instrumentation/jedis/jedis-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/JedisNetAttributesGetter.java index 4ab7c63537e5..1f81c60941b7 100644 --- a/instrumentation/jedis/jedis-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/JedisNetAttributesGetter.java +++ b/instrumentation/jedis/jedis-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/JedisNetAttributesGetter.java @@ -5,13 +5,12 @@ package io.opentelemetry.javaagent.instrumentation.jedis.v4_0; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import java.net.InetSocketAddress; import java.net.SocketAddress; import javax.annotation.Nullable; -final class JedisNetAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { +final class JedisNetAttributesGetter implements NetClientAttributesGetter { @Nullable @Override @@ -27,8 +26,7 @@ public Integer getPeerPort(JedisRequest jedisRequest) { @Override @Nullable - protected InetSocketAddress getPeerSocketAddress( - JedisRequest jedisRequest, @Nullable Void unused) { + public InetSocketAddress getPeerSocketAddress(JedisRequest jedisRequest, @Nullable Void unused) { SocketAddress socketAddress = jedisRequest.getRemoteSocketAddress(); if (socketAddress instanceof InetSocketAddress) { return (InetSocketAddress) socketAddress; diff --git a/instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceNetAttributesGetter.java b/instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceNetAttributesGetter.java index 1d2e87fda48b..41bfd42fe082 100644 --- a/instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceNetAttributesGetter.java +++ b/instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceNetAttributesGetter.java @@ -5,13 +5,13 @@ package io.opentelemetry.instrumentation.lettuce.v5_1; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import io.opentelemetry.instrumentation.lettuce.v5_1.OpenTelemetryTracing.OpenTelemetryEndpoint; import java.net.InetSocketAddress; import javax.annotation.Nullable; final class LettuceNetAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Nullable @Override @@ -27,7 +27,7 @@ public Integer getPeerPort(OpenTelemetryEndpoint openTelemetryEndpoint) { @Nullable @Override - protected InetSocketAddress getPeerSocketAddress( + public InetSocketAddress getPeerSocketAddress( OpenTelemetryEndpoint openTelemetryEndpoint, @Nullable Void unused) { return openTelemetryEndpoint.address; } diff --git a/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/client/NettyConnectNetAttributesGetter.java b/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/client/NettyConnectNetAttributesGetter.java index ac114e24d4a1..a06df542fc73 100644 --- a/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/client/NettyConnectNetAttributesGetter.java +++ b/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/client/NettyConnectNetAttributesGetter.java @@ -8,7 +8,7 @@ import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NetTransportValues.IP_TCP; import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NetTransportValues.IP_UDP; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import io.opentelemetry.instrumentation.netty.common.internal.NettyConnectionRequest; import java.net.InetSocketAddress; import java.net.SocketAddress; @@ -17,7 +17,7 @@ import org.jboss.netty.channel.socket.DatagramChannel; final class NettyConnectNetAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Override public String getTransport(NettyConnectionRequest request, @Nullable Channel channel) { @@ -46,7 +46,7 @@ public Integer getPeerPort(NettyConnectionRequest request) { @Nullable @Override - protected InetSocketAddress getPeerSocketAddress( + public InetSocketAddress getPeerSocketAddress( NettyConnectionRequest request, @Nullable Channel channel) { if (channel == null) { return null; diff --git a/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/client/NettyNetClientAttributesGetter.java b/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/client/NettyNetClientAttributesGetter.java index fa9697db20d8..866b538e73fd 100644 --- a/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/client/NettyNetClientAttributesGetter.java +++ b/instrumentation/netty/netty-3.8/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/netty/v3_8/client/NettyNetClientAttributesGetter.java @@ -8,7 +8,7 @@ import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NetTransportValues.IP_TCP; import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NetTransportValues.IP_UDP; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import io.opentelemetry.javaagent.instrumentation.netty.v3_8.HttpRequestAndChannel; import java.net.InetSocketAddress; import java.net.SocketAddress; @@ -18,7 +18,7 @@ import org.jboss.netty.handler.codec.http.HttpVersion; final class NettyNetClientAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Override public String getTransport( @@ -53,7 +53,7 @@ public Integer getPeerPort(HttpRequestAndChannel requestAndChannel) { @Override @Nullable - protected InetSocketAddress getPeerSocketAddress( + public InetSocketAddress getPeerSocketAddress( HttpRequestAndChannel requestAndChannel, @Nullable HttpResponse response) { SocketAddress address = requestAndChannel.channel().getRemoteAddress(); if (address instanceof InetSocketAddress) { diff --git a/instrumentation/netty/netty-4-common/library/src/main/java/io/opentelemetry/instrumentation/netty/v4/common/internal/client/NettyConnectNetAttributesGetter.java b/instrumentation/netty/netty-4-common/library/src/main/java/io/opentelemetry/instrumentation/netty/v4/common/internal/client/NettyConnectNetAttributesGetter.java index 320d278ed65c..f20a4537158a 100644 --- a/instrumentation/netty/netty-4-common/library/src/main/java/io/opentelemetry/instrumentation/netty/v4/common/internal/client/NettyConnectNetAttributesGetter.java +++ b/instrumentation/netty/netty-4-common/library/src/main/java/io/opentelemetry/instrumentation/netty/v4/common/internal/client/NettyConnectNetAttributesGetter.java @@ -10,14 +10,14 @@ import io.netty.channel.Channel; import io.netty.channel.socket.DatagramChannel; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import io.opentelemetry.instrumentation.netty.common.internal.NettyConnectionRequest; import java.net.InetSocketAddress; import java.net.SocketAddress; import javax.annotation.Nullable; final class NettyConnectNetAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Override public String getTransport(NettyConnectionRequest request, @Nullable Channel channel) { @@ -46,7 +46,7 @@ public Integer getPeerPort(NettyConnectionRequest request) { @Nullable @Override - protected InetSocketAddress getPeerSocketAddress( + public InetSocketAddress getPeerSocketAddress( NettyConnectionRequest request, @Nullable Channel channel) { if (channel == null) { return null; diff --git a/instrumentation/netty/netty-4-common/library/src/main/java/io/opentelemetry/instrumentation/netty/v4/common/internal/client/NettyNetClientAttributesGetter.java b/instrumentation/netty/netty-4-common/library/src/main/java/io/opentelemetry/instrumentation/netty/v4/common/internal/client/NettyNetClientAttributesGetter.java index cd01f79e631d..34a47cb5a6ce 100644 --- a/instrumentation/netty/netty-4-common/library/src/main/java/io/opentelemetry/instrumentation/netty/v4/common/internal/client/NettyNetClientAttributesGetter.java +++ b/instrumentation/netty/netty-4-common/library/src/main/java/io/opentelemetry/instrumentation/netty/v4/common/internal/client/NettyNetClientAttributesGetter.java @@ -11,14 +11,14 @@ import io.netty.channel.socket.DatagramChannel; import io.netty.handler.codec.http.HttpResponse; import io.netty.handler.codec.http.HttpVersion; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import io.opentelemetry.instrumentation.netty.v4.common.HttpRequestAndChannel; import java.net.InetSocketAddress; import java.net.SocketAddress; import javax.annotation.Nullable; final class NettyNetClientAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Override public String getTransport( @@ -53,7 +53,7 @@ public Integer getPeerPort(HttpRequestAndChannel requestAndChannel) { @Override @Nullable - protected InetSocketAddress getPeerSocketAddress( + public InetSocketAddress getPeerSocketAddress( HttpRequestAndChannel requestAndChannel, @Nullable HttpResponse response) { SocketAddress address = requestAndChannel.remoteAddress(); if (address instanceof InetSocketAddress) { diff --git a/instrumentation/netty/netty-4-common/library/src/main/java/io/opentelemetry/instrumentation/netty/v4/common/internal/client/NettySslNetAttributesGetter.java b/instrumentation/netty/netty-4-common/library/src/main/java/io/opentelemetry/instrumentation/netty/v4/common/internal/client/NettySslNetAttributesGetter.java index 84d22b71cdc3..692983c94d7c 100644 --- a/instrumentation/netty/netty-4-common/library/src/main/java/io/opentelemetry/instrumentation/netty/v4/common/internal/client/NettySslNetAttributesGetter.java +++ b/instrumentation/netty/netty-4-common/library/src/main/java/io/opentelemetry/instrumentation/netty/v4/common/internal/client/NettySslNetAttributesGetter.java @@ -9,12 +9,12 @@ import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NetTransportValues.IP_UDP; import io.netty.channel.socket.DatagramChannel; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import java.net.InetSocketAddress; import javax.annotation.Nullable; final class NettySslNetAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Override public String getTransport(NettySslRequest request, @Nullable Void unused) { @@ -35,7 +35,7 @@ public Integer getPeerPort(NettySslRequest nettySslRequest) { @Nullable @Override - protected InetSocketAddress getPeerSocketAddress(NettySslRequest request, @Nullable Void unused) { + public InetSocketAddress getPeerSocketAddress(NettySslRequest request, @Nullable Void unused) { if (request.remoteAddress() instanceof InetSocketAddress) { return (InetSocketAddress) request.remoteAddress(); } diff --git a/instrumentation/play/play-ws/play-ws-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/playws/PlayWsClientNetAttributesGetter.java b/instrumentation/play/play-ws/play-ws-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/playws/PlayWsClientNetAttributesGetter.java index 99a62e10299e..3e5141c5bf3c 100644 --- a/instrumentation/play/play-ws/play-ws-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/playws/PlayWsClientNetAttributesGetter.java +++ b/instrumentation/play/play-ws/play-ws-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/playws/PlayWsClientNetAttributesGetter.java @@ -5,14 +5,14 @@ package io.opentelemetry.javaagent.instrumentation.playws; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import java.net.InetSocketAddress; import javax.annotation.Nullable; import play.shaded.ahc.org.asynchttpclient.Request; import play.shaded.ahc.org.asynchttpclient.Response; final class PlayWsClientNetAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Nullable @Override @@ -27,7 +27,7 @@ public Integer getPeerPort(Request request) { @Override @Nullable - protected InetSocketAddress getPeerSocketAddress(Request request, @Nullable Response response) { + public InetSocketAddress getPeerSocketAddress(Request request, @Nullable Response response) { if (response != null && response.getRemoteAddress() instanceof InetSocketAddress) { return (InetSocketAddress) response.getRemoteAddress(); } diff --git a/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettyNetClientAttributesGetter.java b/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettyNetClientAttributesGetter.java index 79ee55de86e8..9eda3be62e40 100644 --- a/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettyNetClientAttributesGetter.java +++ b/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/reactornetty/v1_0/ReactorNettyNetClientAttributesGetter.java @@ -6,7 +6,7 @@ package io.opentelemetry.javaagent.instrumentation.reactornetty.v1_0; import io.netty.handler.codec.http.HttpVersion; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import java.net.InetSocketAddress; import java.net.SocketAddress; import javax.annotation.Nullable; @@ -15,7 +15,7 @@ import reactor.netty.http.client.HttpClientResponse; final class ReactorNettyNetClientAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Nullable @Override @@ -51,7 +51,7 @@ public Integer getPeerPort(HttpClientConfig request) { @Nullable @Override - protected InetSocketAddress getPeerSocketAddress( + public InetSocketAddress getPeerSocketAddress( HttpClientConfig request, @Nullable HttpClientResponse response) { // we're making use of the fact that HttpClientOperations is both a Connection and an diff --git a/instrumentation/redisson/redisson-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/RedissonNetAttributesGetter.java b/instrumentation/redisson/redisson-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/RedissonNetAttributesGetter.java index 333a846ecefd..f0d3724c9b7c 100644 --- a/instrumentation/redisson/redisson-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/RedissonNetAttributesGetter.java +++ b/instrumentation/redisson/redisson-common/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/redisson/RedissonNetAttributesGetter.java @@ -5,12 +5,12 @@ package io.opentelemetry.javaagent.instrumentation.redisson; -import io.opentelemetry.instrumentation.api.instrumenter.net.InetSocketAddressNetClientAttributesGetter; +import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import java.net.InetSocketAddress; import javax.annotation.Nullable; final class RedissonNetAttributesGetter - extends InetSocketAddressNetClientAttributesGetter { + implements NetClientAttributesGetter { @Nullable @Override @@ -25,7 +25,7 @@ public Integer getPeerPort(RedissonRequest redissonRequest) { } @Override - protected InetSocketAddress getPeerSocketAddress(RedissonRequest request, @Nullable Void unused) { + public InetSocketAddress getPeerSocketAddress(RedissonRequest request, @Nullable Void unused) { return request.getAddress(); } }