public final class BinaryAnnotation extends Object
BinaryAnnotation.Type.STRING are always queryable, though more a historical
implementation detail than a structural concern.
Binary annotations can repeat, and vary on the host. Similar to Annotation, the host
indicates who logged the event. This allows you to tell the difference between the client and
server side of the same key. For example, the key "http.uri" might be different on the client and
server side due to rewriting, like "/api/v1/myresource" vs "/myresource. Via the host field, you
can see the different points of view, which often help in debugging.| Modifier and Type | Class and Description |
|---|---|
static class |
BinaryAnnotation.Builder |
static class |
BinaryAnnotation.Type
A subset of thrift base types, except BYTES.
|
| Modifier and Type | Field and Description |
|---|---|
Endpoint |
endpoint
The host that recorded
value, allowing query by service name or address. |
String |
key
Name used to lookup spans, such as "http.uri" or "finagle.version".
|
BinaryAnnotation.Type |
type
The thrift type of value, most often STRING.
|
byte[] |
value
Serialized thrift bytes, in TBinaryProtocol format.
|
| Modifier and Type | Method and Description |
|---|---|
static BinaryAnnotation |
address(String key,
Endpoint endpoint)
Special-cased form supporting
Constants.CLIENT_ADDR and
Constants.SERVER_ADDR. |
static BinaryAnnotation |
create(String key,
byte[] value,
BinaryAnnotation.Type type,
Endpoint endpoint) |
static BinaryAnnotation |
create(String key,
String value,
Endpoint endpoint)
String values are the only queryable type of binary annotation.
|
boolean |
equals(Object o) |
int |
hashCode() |
String |
toString() |
public final String key
public final byte[] value
public final BinaryAnnotation.Type type
@Nullable public final Endpoint endpoint
value, allowing query by service name or address.
There are two exceptions: when key is Constants.CLIENT_ADDR or Constants.SERVER_ADDR, this is the source or destination of an RPC. This exception allows
zipkin to display network context of uninstrumented services, such as browsers or databases.public static BinaryAnnotation address(String key, Endpoint endpoint)
Constants.CLIENT_ADDR and
Constants.SERVER_ADDR.key - Constants.CLIENT_ADDR or Constants.SERVER_ADDRendpoint - associated endpoint.public static BinaryAnnotation create(String key, String value, @Nullable Endpoint endpoint)
public static BinaryAnnotation create(String key, byte[] value, BinaryAnnotation.Type type, @Nullable Endpoint endpoint)
Copyright © 2015–2016 OpenZipkin. All rights reserved.