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 - unix domain socket name, IPv4 or IPv6 address.default InetSocketAddressgetClientInetSocketAddress(REQUEST request, RESPONSE response) Returns anInetSocketAddressobject representing the immediate client socket address.default IntegergetClientPort(REQUEST request) Returns the client port number.default StringgetClientSocketAddress(REQUEST request, RESPONSE response) Returns the immediate client peer address - unix domain socket name, IPv4 or IPv6 address.default IntegergetClientSocketPort(REQUEST request, RESPONSE response) Returns the immediate client peer port number.
-
Method Details
-
getClientAddress
Returns the client address - unix domain socket name, IPv4 or IPv6 address.Examples:
/tmp/my.sock,10.1.2.80 -
getClientPort
Returns the client port number.Examples:
65123 -
getClientInetSocketAddress
@Nullable default InetSocketAddress getClientInetSocketAddress(REQUEST request, @Nullable RESPONSE response) Returns anInetSocketAddressobject representing the immediate client socket address.Implementing this method is equivalent to implementing all of
getClientSocketAddress(Object, Object)andgetClientSocketPort(Object, Object). -
getClientSocketAddress
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
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).
-