public final class TraceKeys extends Object
binary annotation aka Tag keys
.
When evaluating new keys, consider how much additional data it implies, and if that data is critical to classifying, filtering or displaying traces. More data often means larger systems, less retention, or a lower sample rate.
For example, in zipkin, a thrift-encoded span with an "sr" annotation is 82 bytes plus the size of its name and associated service. The maximum size of an HTTP cookie is 4096 bytes, roughly 50x that. Even if compression helps, if you aren't analyzing based on cookies, storing them displaces resources that could be used for more traces. Meanwhile, you have another system storing private data! The takeaway isn't never store cookies, as there are valid cases for this. The takeaway is to be conscious about what's you are storing.
Modifier and Type | Field and Description |
---|---|
static String |
HTTP_HOST
The domain portion of the URL or host header.
|
static String |
HTTP_METHOD
The HTTP method, or verb, such as "GET" or "POST".
|
static String |
HTTP_PATH
The absolute http path, without any query parameters.
|
static String |
HTTP_REQUEST_SIZE
The size of the non-empty HTTP request body, in bytes.
|
static String |
HTTP_RESPONSE_SIZE
The size of the non-empty HTTP response body, in bytes.
|
static String |
HTTP_ROUTE
The route which a request matched or "" (empty string) if routing is supported, but there was
no match.
|
static String |
HTTP_STATUS_CODE
The HTTP status code, when not in 2xx range.
|
static String |
HTTP_URL
The entire URL, including the scheme, host and query parameters if available.
|
static String |
SQL_QUERY
The query executed for SQL call.
|
public static final String HTTP_HOST
Used to filter by host as opposed to ip address.
public static final String HTTP_METHOD
Used to filter against an http route.
public static final String HTTP_PATH
Used as a filter or to clarify the request path for a given route. For example, the path for
a route "/objects/:objectId" could be "/objects/abdc-ff". This does not limit cardinality like
HTTP_ROUTE
can, so is not a good input to a span name.
The Zipkin query api only supports equals filters. Dropping query parameters makes the number of distinct URIs less. For example, one can query for the same resource, regardless of signing parameters encoded in the query line. Dropping query parameters also limits the security impact of this tag.
Historical note: This was commonly expressed as "http.uri" in zipkin, even though it was most
public static final String HTTP_ROUTE
Often used as a span name when known, with empty routes coercing to "not_found" or
"redirected" based on HTTP_STATUS_CODE
.
Unlike HTTP_PATH
, this value is fixed cardinality, so is a safe input to a span
name function or a metrics dimension. Different formats are possible. For example, the
following are all valid route templates: "/objects" "/objects/:objectId" "/objects/*"
public static final String HTTP_URL
Combined with HTTP_METHOD, you can understand the fully-qualified request line.
This is optional as it may include private data or be of considerable length.
public static final String HTTP_STATUS_CODE
Used to filter for error status.
public static final String HTTP_REQUEST_SIZE
Large uploads can exceed limits or contribute directly to latency.
public static final String HTTP_RESPONSE_SIZE
Large downloads can exceed limits or contribute directly to latency.
public static final String SQL_QUERY
Used to understand the complexity of a request
Copyright © 2015–2018 OpenZipkin. All rights reserved.