Interface NetworkAttributesGetter<REQUEST,RESPONSE>
- All Known Subinterfaces:
HttpClientAttributesGetter<REQUEST,,RESPONSE> HttpServerAttributesGetter<REQUEST,RESPONSE>
Instrumentation authors will create implementations of this interface for their specific
library/framework. It will be used by the NetworkAttributesExtractor (or other convention
specific extractors) to obtain the various network attributes in a type-generic way.
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetNetworkLocalAddress(REQUEST request, RESPONSE response) Returns the local address of the network connection - IP address or Unix domain socket name.default InetSocketAddressgetNetworkLocalInetSocketAddress(REQUEST request, RESPONSE response) Returns anInetSocketAddressobject representing the local socket address.default IntegergetNetworkLocalPort(REQUEST request, RESPONSE response) Returns the local port number of the network connection.default StringgetNetworkPeerAddress(REQUEST request, RESPONSE response) Returns the peer address of the network connection - IP address or Unix domain socket name.default InetSocketAddressgetNetworkPeerInetSocketAddress(REQUEST request, RESPONSE response) Returns anInetSocketAddressobject representing the peer socket address.default IntegergetNetworkPeerPort(REQUEST request, RESPONSE response) Returns the peer port number of the network connection.default StringgetNetworkProtocolName(REQUEST request, RESPONSE response) Returns the OSI application layer or non-OSI equivalent.default StringgetNetworkProtocolVersion(REQUEST request, RESPONSE response) Returns the version of the protocol returned bygetNetworkProtocolName(Object, Object).default StringgetNetworkTransport(REQUEST request, RESPONSE response) Returns the OSI transport layer or inter-process communication method.default StringgetNetworkType(REQUEST request, RESPONSE response) Returns the OSI network layer or non-OSI equivalent.
-
Method Details
-
getNetworkType
Returns the OSI network layer or non-OSI equivalent.Examples:
ipv4,ipv6 -
getNetworkTransport
-
getNetworkProtocolName
Returns the OSI application layer or non-OSI equivalent.Examples:
ampq,http,mqtt -
getNetworkProtocolVersion
Returns the version of the protocol returned bygetNetworkProtocolName(Object, Object).Examples:
3.1.1 -
getNetworkLocalInetSocketAddress
@Nullable default InetSocketAddress getNetworkLocalInetSocketAddress(REQUEST request, @Nullable RESPONSE response) Returns anInetSocketAddressobject representing the local socket address.Implementing this method is equivalent to implementing both
getNetworkLocalAddress(Object, Object)andgetNetworkLocalPort(Object, Object). -
getNetworkLocalAddress
Returns the local address of the network connection - IP address or Unix domain socket name.Examples:
10.1.2.80,/tmp/my.sockBy default, this method attempts to retrieve the local address using the
getNetworkLocalInetSocketAddress(Object, Object)method. If that 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 ofgetNetworkLocalInetSocketAddress(Object, Object). -
getNetworkLocalPort
Returns the local port number of the network connection.Examples:
65123By default, this method attempts to retrieve the local port using the
getNetworkLocalInetSocketAddress(Object, Object)method. If that 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 ofgetNetworkLocalInetSocketAddress(Object, Object). -
getNetworkPeerInetSocketAddress
@Nullable default InetSocketAddress getNetworkPeerInetSocketAddress(REQUEST request, @Nullable RESPONSE response) Returns anInetSocketAddressobject representing the peer socket address.Implementing this method is equivalent to implementing both
getNetworkPeerAddress(Object, Object)andgetNetworkPeerPort(Object, Object). -
getNetworkPeerAddress
Returns the peer address of the network connection - IP address or Unix domain socket name.Examples:
10.1.2.80,/tmp/my.sockBy default, this method attempts to retrieve the peer address using the
getNetworkPeerInetSocketAddress(Object, Object)method. If that 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 ofgetNetworkPeerInetSocketAddress(Object, Object). -
getNetworkPeerPort
Returns the peer port number of the network connection.Examples:
65123By default, this method attempts to retrieve the peer port using the
getNetworkPeerInetSocketAddress(Object, Object)method. If that 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 ofgetNetworkPeerInetSocketAddress(Object, Object).
-