Package io.opencensus.contrib.http
Class HttpExtractor<Q,P>
java.lang.Object
io.opencensus.contrib.http.HttpExtractor<Q,P>
- Type Parameters:
Q
- the HTTP request entity.P
- the HTTP response entity.
- Direct Known Subclasses:
JaxrsClientExtractor
,JaxrsContainerExtractor
,OcHttpServletExtractor
,OcJettyHttpClientExtractor
An adaptor to extract information from request and response.
This class provides no-op implementations by default.
Please refer to this document for more information about the HTTP attributes recorded in Open Census.
- Since:
- 0.19
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract String
Returns the request URL host.abstract String
Returns the request method.abstract String
Returns the request URL path.abstract String
Returns the request route.abstract int
getStatusCode
(P response) Returns the response status code.abstract String
Returns the request URL.abstract String
getUserAgent
(Q request) Returns the request user agent.
-
Constructor Details
-
HttpExtractor
public HttpExtractor()
-
-
Method Details
-
getRoute
Returns the request route.- Parameters:
request
- the HTTP request.- Returns:
- the request route.
- Since:
- 0.19
-
getUrl
Returns the request URL.- Parameters:
request
- the HTTP request.- Returns:
- the request URL.
- Since:
- 0.19
-
getHost
Returns the request URL host.- Parameters:
request
- the HTTP request.- Returns:
- the request URL host.
- Since:
- 0.19
-
getMethod
Returns the request method.- Parameters:
request
- the HTTP request.- Returns:
- the request method.
- Since:
- 0.19
-
getPath
Returns the request URL path.- Parameters:
request
- the HTTP request.- Returns:
- the request URL path.
- Since:
- 0.19
-
getUserAgent
Returns the request user agent.- Parameters:
request
- the HTTP request.- Returns:
- the request user agent.
- Since:
- 0.19
-
getStatusCode
Returns the response status code. If the response is null, this method should return0
.- Parameters:
response
- the HTTP response.- Returns:
- the response status code.
- Since:
- 0.19
-