Interface HttpCommonAttributesGetter<REQUEST,RESPONSE>

All Known Subinterfaces:
HttpClientAttributesGetter<REQUEST,RESPONSE>, HttpServerAttributesGetter<REQUEST,RESPONSE>

public interface HttpCommonAttributesGetter<REQUEST,RESPONSE>
An interface for getting HTTP attributes common to clients and servers.
  • Method Details

    • getHttpRequestMethod

      @Nullable String getHttpRequestMethod(REQUEST request)
      Returns the HTTP request method.

      Examples: GET, POST, HEAD

    • getHttpRequestHeader

      List<String> getHttpRequestHeader(REQUEST request, String name)
      Returns all values of header named name from the request, or an empty list if there were none.

      Implementations of this method must not return a null value; an empty list should be returned instead.

    • getHttpResponseStatusCode

      @Nullable Integer getHttpResponseStatusCode(REQUEST request, RESPONSE response, @Nullable Throwable error)
      Returns the HTTP response status code.

      Examples: 200

      This is called from Instrumenter.end(Context, Object, Object, Throwable), only when response is non-null.

    • getHttpResponseHeader

      List<String> getHttpResponseHeader(REQUEST request, RESPONSE response, String name)
      Returns all values of header named name from the response, or an empty list if there were none.

      This is called from Instrumenter.end(Context, Object, Object, Throwable), only when response is non-null.

      Implementations of this method must not return a null value; an empty list should be returned instead.