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 Summary
Modifier and TypeMethodDescriptiongetHttpRequestHeader(REQUEST request, String name) Returns all values of header namednamefrom the request, or an empty list if there were none.getHttpRequestMethod(REQUEST request) Returns the HTTP request method.getHttpResponseHeader(REQUEST request, RESPONSE response, String name) Returns all values of header namednamefrom the response, or an empty list if there were none.getHttpResponseStatusCode(REQUEST request, RESPONSE response, Throwable error) Returns the HTTP response status code.
-
Method Details
-
getHttpRequestMethod
Returns the HTTP request method.Examples:
GET,POST,HEAD -
getHttpRequestHeader
Returns all values of header namednamefrom 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:
200This is called from
Instrumenter.end(Context, Object, Object, Throwable), only whenresponseis non-null. -
getHttpResponseHeader
Returns all values of header namednamefrom the response, or an empty list if there were none.This is called from
Instrumenter.end(Context, Object, Object, Throwable), only whenresponseis non-null.Implementations of this method must not return a null value; an empty list should be returned instead.
-