Interface ServerAttributesGetter<REQUEST,RESPONSE>
- All Known Subinterfaces:
HttpClientAttributesGetter<REQUEST,,RESPONSE> HttpServerAttributesGetter<REQUEST,,RESPONSE> NetClientAttributesGetter<REQUEST,,RESPONSE> NetServerAttributesGetter<REQUEST,RESPONSE>
Instrumentation authors will create implementations of this interface for their specific
library/framework. It will be used by the ServerAttributesExtractor (or other convention
specific extractors) to obtain the various server attributes in a type-generic way.
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetServerAddress(REQUEST request) Returns the server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.default InetSocketAddressgetServerInetSocketAddress(REQUEST request, RESPONSE response) Deprecated.default IntegergetServerPort(REQUEST request) Return the server port number.default StringgetServerSocketAddress(REQUEST request, RESPONSE response) Deprecated.default StringgetServerSocketDomain(REQUEST request, RESPONSE response) Deprecated.This method is deprecated and will be removed without replacement.default IntegergetServerSocketPort(REQUEST request, RESPONSE response) Deprecated.
-
Method Details
-
getServerAddress
Returns the server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.Examples:
client.example.com,10.1.2.80,/tmp/my.sock -
getServerPort
Return the server port number.Examples:
80,8080,443 -
getServerInetSocketAddress
@Deprecated @Nullable default InetSocketAddress getServerInetSocketAddress(REQUEST request, @Nullable RESPONSE response) Deprecated.Returns anInetSocketAddressobject representing the server socket address.Implementing this method is equivalent to implementing all of
getServerSocketDomain(Object, Object),getServerSocketAddress(Object, Object)andgetServerSocketPort(Object, Object). -
getServerSocketDomain
@Deprecated @Nullable default String getServerSocketDomain(REQUEST request, @Nullable RESPONSE response) Deprecated.This method is deprecated and will be removed without replacement.Return the domain name of an immediate peer.Examples:
proxy.example.comBy default, this method attempts to retrieve the server domain name using the
getServerInetSocketAddress(Object, Object)method. If this method is not implemented, it will simply returnnull. If the instrumented library does not exposeInetSocketAddressin its API, you might want to implement this method instead ofgetServerInetSocketAddress(Object, Object). -
getServerSocketAddress
@Deprecated @Nullable default String getServerSocketAddress(REQUEST request, @Nullable RESPONSE response) Deprecated.Return the physical server IP address or Unix socket address.Examples:
10.5.3.2By default, this method attempts to retrieve the server address using the
getServerInetSocketAddress(Object, Object)method. If this method is not implemented, it will simply returnnull. If the instrumented library does not exposeInetSocketAddressin its API, you might want to implement this method instead ofgetServerInetSocketAddress(Object, Object). -
getServerSocketPort
@Deprecated @Nullable default Integer getServerSocketPort(REQUEST request, @Nullable RESPONSE response) Deprecated.Return the physical server port.Examples:
16456By default, this method attempts to retrieve the server port using the
getServerInetSocketAddress(Object, Object)method. If this method is not implemented, it will simply returnnull. If the instrumented library does not exposeInetSocketAddressin its API, you might want to implement this method instead ofgetServerInetSocketAddress(Object, Object).
-
NetworkAttributesGetter.getNetworkPeerInetSocketAddress(Object, Object)orNetworkAttributesGetter.getNetworkLocalInetSocketAddress(Object, Object)instead.