Package brave.http
Class HttpTags
- java.lang.Object
-
- brave.http.HttpTags
-
public final class HttpTags extends Object
Standard tags used in request and response parsers.- Since:
- 5.11
- See Also:
HttpRequestParser,HttpResponseParser
-
-
Field Summary
Fields Modifier and Type Field Description static Tag<HttpRequest>METHODThis tags "http.method" as the value ofHttpRequest.method(), such as "GET" or "POST".static Tag<HttpRequest>PATHThis tags "http.path" as the value ofHttpRequest.path().static Tag<HttpRequest>ROUTEThis tags "http.route" as the value ofHttpRequest.route().static Tag<HttpResponse>STATUS_CODEThis tags "http.status_code" as the value ofHttpResponse.statusCode(), when a valid status code (100 - 599).static Tag<HttpRequest>URLThis tags "http.url" as the value ofHttpRequest.url().
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Tag<HttpRequest>requestHeader(String headerName)Creates a tag for the given HTTP request header.static Tag<HttpRequest>requestHeader(String key, String headerName)LikerequestHeader(String), except controls the tag key used.
-
-
-
Field Detail
-
METHOD
public static final Tag<HttpRequest> METHOD
This tags "http.method" as the value ofHttpRequest.method(), such as "GET" or "POST".
-
PATH
public static final Tag<HttpRequest> PATH
This tags "http.path" as the value ofHttpRequest.path(). Ex. "/objects/abcd-ff"- Since:
- 5.11
- See Also:
HttpRequest.path(),ROUTE,HttpRequestParser.parse(HttpRequest, TraceContext, SpanCustomizer),HttpResponse.request()
-
ROUTE
public static final Tag<HttpRequest> ROUTE
This tags "http.route" as the value ofHttpRequest.route(). Ex "/users/{userId}" or "" (empty string) if routing is supported, but there was no match.- Since:
- 5.11
- See Also:
HttpRequest.route(),PATH,HttpRequestParser.parse(HttpRequest, TraceContext, SpanCustomizer),HttpResponse.request()
-
URL
public static final Tag<HttpRequest> URL
This tags "http.url" as the value ofHttpRequest.url(). UnlikePATH, this includes the scheme, host and query parameters.Ex. "https://mybucket.s3.amazonaws.com/objects/abcd-ff?X-Amz-Algorithm=AWS4-HMAC-SHA256..."
Combined with
METHOD, you can understand the fully-qualified request line.Caution:This may include private data or be of considerable length.
- Since:
- 5.11
- See Also:
HttpRequest.url(),PATH,HttpRequestParser.parse(HttpRequest, TraceContext, SpanCustomizer),HttpResponse.request()
-
STATUS_CODE
public static final Tag<HttpResponse> STATUS_CODE
This tags "http.status_code" as the value ofHttpResponse.statusCode(), when a valid status code (100 - 599).- Since:
- 5.11
- See Also:
HttpResponse.statusCode(),HttpResponseParser.parse(HttpResponse, TraceContext, SpanCustomizer)
-
-
Method Detail
-
requestHeader
public static Tag<HttpRequest> requestHeader(String headerName)
Creates a tag for the given HTTP request header.Ex.
USER_AGENT = HttpTags.requestHeader("User-Agent");- Since:
- 5.11
- See Also:
HttpRequest.header(String),HttpResponse.request()
-
requestHeader
public static Tag<HttpRequest> requestHeader(String key, String headerName)
LikerequestHeader(String), except controls the tag key used.Ex.
USER_AGENT = HttpTags.requestHeader("http.user_agent", "User-Agent");- Since:
- 5.11
- See Also:
HttpRequest.header(String),HttpResponse.request()
-
-