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

    • method

      @Nullable String method(REQUEST request)
    • requestHeader

      List<String> requestHeader(REQUEST request, String name)
      Extracts 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.

    • requestContentLength

      @Nullable Long requestContentLength(REQUEST request, @Nullable RESPONSE response)
      Extracts the http.request_content_length span attribute.

      This is called from Instrumenter.end(Context, Object, Object, Throwable), whether response is null or not.

    • requestContentLengthUncompressed

      @Nullable Long requestContentLengthUncompressed(REQUEST request, @Nullable RESPONSE response)
      Extracts the http.request_content_length_uncompressed span attribute.

      This is called from Instrumenter.end(Context, Object, Object, Throwable), whether response is null or not.

    • statusCode

      @Nullable Integer statusCode(REQUEST request, RESPONSE response)
      Extracts the http.status_code span attribute.

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

    • responseContentLength

      @Nullable Long responseContentLength(REQUEST request, RESPONSE response)
      Extracts the http.response_content_length span attribute.

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

    • responseContentLengthUncompressed

      @Nullable Long responseContentLengthUncompressed(REQUEST request, RESPONSE response)
      Extracts the http.response_content_length_uncompressed span attribute.

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

    • responseHeader

      List<String> responseHeader(REQUEST request, RESPONSE response, String name)
      Extracts 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.