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.

    • statusCode

      @Nullable Integer statusCode(REQUEST request, RESPONSE response, @Nullable Throwable error)
      Extracts the http.status_code 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.