Interface ServerAttributesGetter<REQUEST>

All Known Subinterfaces:
HttpClientAttributesGetter<REQUEST,RESPONSE>

public interface ServerAttributesGetter<REQUEST>
An interface for getting attributes describing a network server.

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.

Since:
2.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    Returns the server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
    default Integer
    Return the server port number.
  • Method Details

    • getServerAddress

      @Nullable default String getServerAddress(REQUEST request)
      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

      @Nullable default Integer getServerPort(REQUEST request)
      Return the server port number.

      Examples: 80, 8080, 443