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) Return the logical server hostname that matches server FQDN if available, and IP or socket address if FQDN is not known.default InetSocketAddressgetServerInetSocketAddress(REQUEST request, RESPONSE response) Returns anInetSocketAddressobject representing the server socket address.default IntegergetServerPort(REQUEST request) Return the logical server port number.default StringgetServerSocketAddress(REQUEST request, RESPONSE response) Return the physical server IP address or Unix socket address.default StringgetServerSocketDomain(REQUEST request, RESPONSE response) Return the domain name of an immediate peer.default IntegergetServerSocketPort(REQUEST request, RESPONSE response) Return the physical server port.
-
Method Details
-
getServerAddress
Return the logical server hostname that matches server FQDN if available, and IP or socket address if FQDN is not known.Examples:
example.com -
getServerPort
Return the logical server port number.Examples:
80,8080,443 -
getServerInetSocketAddress
@Nullable default InetSocketAddress getServerInetSocketAddress(REQUEST request, @Nullable RESPONSE response) 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
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
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
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).
-