PropagationCodec<String>public class HttpHeaderV1PropagationCodec extends Object implements PropagationCodec<String>
Propagation.honeycombHeaderV1() factory method to retrieve an instance.
The design of this class avoids throwing exceptions in favour of logging warnings and returning null on encode or an "empty context" on decode.
| Modifier and Type | Class | Description |
|---|---|---|
static class |
HttpHeaderV1PropagationCodec.DefaultJsonConverter |
| Modifier and Type | Field | Description |
|---|---|---|
static String |
HONEYCOMB_TRACE_HEADER |
| Constructor | Description |
|---|---|
HttpHeaderV1PropagationCodec() |
|
HttpHeaderV1PropagationCodec(io.honeycomb.libhoney.transport.json.JsonSerializer<? super Map<String,?>> serializer,
JsonDeserializer<? extends Map<String,Object>> deserializer) |
| Modifier and Type | Method | Description |
|---|---|---|
PropagationContext |
decode(String encodedTrace) |
This decodes the 'x-honeycomb-trace' header of the following format:
|
Optional<String> |
encode(PropagationContext context) |
This encodes the given trace context in the format accepted by the 'x-honeycomb-trace' header.
|
static HttpHeaderV1PropagationCodec |
getInstance() |
public static final String HONEYCOMB_TRACE_HEADER
public HttpHeaderV1PropagationCodec(io.honeycomb.libhoney.transport.json.JsonSerializer<? super Map<String,?>> serializer, JsonDeserializer<? extends Map<String,Object>> deserializer)
public HttpHeaderV1PropagationCodec()
public static HttpHeaderV1PropagationCodec getInstance()
public PropagationContext decode(String encodedTrace)
1;trace_id={traceId},parent_id={parentId},dataset={dataset},context={Base64-encoded json}
Trace_id and parent_id are required to create a non-empty Propagation context, while dataset and context are treated as optional.
decode in interface PropagationCodec<String>encodedTrace - to decode into a PropagationContext.public Optional<String> encode(PropagationContext context)
encode in interface PropagationCodec<String>context - to encode into a valid header value.Copyright © 2019–2020 Honeycomb. All rights reserved.