public class SpanSerializer
extends java.lang.Object
Span serializer is intended to be used when a span needs to be serialized before transferring it to another JVM. On the other end, it is used to deserialize the transferred span.
Span metadata must be set on the same instance of Span on which Span.start() is called as it is
discarded in the serialized format. The service name, application name and user identity are also discarded in the
serialized format, however there is no need to set those properties for a child span as they only have an effect
when used on a root span.
| Modifier and Type | Field and Description |
|---|---|
static int |
API_VERSION |
| Constructor and Description |
|---|
SpanSerializer() |
| Modifier and Type | Method and Description |
|---|---|
static Span |
fromBase64(java.lang.String string)
Deserializes a
Span from a base-64 string representation. |
static Span |
fromByteArray(byte[] buffer)
Deserializes a
Span from a byte array. |
static java.lang.String |
toBase64(Span span)
Serializes a
Span to a base-64 string representation. |
static byte[] |
toByteArray(Span span)
Serializes a
Span to a byte array. |
public static final int API_VERSION
public static Span fromByteArray(byte[] buffer)
Span from a byte array. The contents of the byte array must have been obtained by previously
calling toByteArray(Span).buffer - Byte array representing the serialized span.Span if the input was valid, Plumbr Agent is attached and is not too old to
support this API version. In any other case, returns a null span (Span.isNull() returns
true).public static Span fromBase64(java.lang.String string)
Span from a base-64 string representation. The contents of the byte array must have been
obtained by previously calling toBase64(Span).string - Base-64 formatted string representing the serialized span.Span if the input was valid, Plumbr Agent is attached and is not too old to
support this API version. In any other case, returns a null span (Span.isNull() returns
true).public static byte[] toByteArray(Span span)
Span to a byte array. Use fromByteArray(byte[]) (String)} to deserialize.span - Span to serialize.public static java.lang.String toBase64(Span span)
Span to a base-64 string representation. Use fromBase64(String) to deserialize.span - Span to serialize.