Interface ClientAttributesGetter<REQUEST,RESPONSE>
- All Known Subinterfaces:
HttpServerAttributesGetter<REQUEST,,RESPONSE> NetServerAttributesGetter<REQUEST,RESPONSE>
Instrumentation authors will create implementations of this interface for their specific
library/framework. It will be used by the ClientAttributesExtractor (or other convention
specific extractors) to obtain the various server attributes in a type-generic way.
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetClientAddress(REQUEST request) Returns the client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.default InetSocketAddressgetClientInetSocketAddress(REQUEST request, RESPONSE response) Deprecated.default IntegergetClientPort(REQUEST request) Returns the client port number.default StringgetClientSocketAddress(REQUEST request, RESPONSE response) Deprecated.ImplementNetworkAttributesGetter.getNetworkPeerAddress(Object, Object)instead.default IntegergetClientSocketPort(REQUEST request, RESPONSE response) Deprecated.ImplementNetworkAttributesGetter.getNetworkPeerPort(Object, Object)instead.
-
Method Details
-
getClientAddress
Returns the client address - 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 -
getClientPort
Returns the client port number.Examples:
65123 -
getClientInetSocketAddress
@Deprecated @Nullable default InetSocketAddress getClientInetSocketAddress(REQUEST request, @Nullable RESPONSE response) Deprecated.ImplementNetworkAttributesGetter.getNetworkPeerInetSocketAddress(Object, Object)instead.Returns anInetSocketAddressobject representing the immediate client socket address.Implementing this method is equivalent to implementing all of
getClientSocketAddress(Object, Object)andgetClientSocketPort(Object, Object). -
getClientSocketAddress
@Deprecated @Nullable default String getClientSocketAddress(REQUEST request, @Nullable RESPONSE response) Deprecated.ImplementNetworkAttributesGetter.getNetworkPeerAddress(Object, Object)instead.Returns the immediate client peer address - unix domain socket name, IPv4 or IPv6 address.Examples:
/tmp/my.sock,127.0.0.1By default, this method attempts to retrieve the immediate client address using the
getClientInetSocketAddress(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 ofgetClientInetSocketAddress(Object, Object). -
getClientSocketPort
@Deprecated @Nullable default Integer getClientSocketPort(REQUEST request, @Nullable RESPONSE response) Deprecated.ImplementNetworkAttributesGetter.getNetworkPeerPort(Object, Object)instead.Returns the immediate client peer port number.Examples:
35555By default, this method attempts to retrieve the immediate client port using the
getClientInetSocketAddress(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 ofgetClientInetSocketAddress(Object, Object).
-
NetworkAttributesGetter.getNetworkPeerInetSocketAddress(Object, Object)instead.