diff options
author | Bogdan Drutu <bdrutu@google.com> | 2018-08-09 10:09:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-09 10:09:28 -0700 |
commit | 52f38e48e2ac6cb65e28dcd97b4f7e9650357bba (patch) | |
tree | b5dc40e7e3805ece5011f1d253622e69bccc15f6 /impl_core/src/main/java/io/opencensus/implcore/trace/propagation/BinaryFormatImpl.java | |
parent | 18aa2793facbb3d7e252ac32e6bb4d09f08a37ac (diff) | |
download | opencensus-java-52f38e48e2ac6cb65e28dcd97b4f7e9650357bba.tar.gz |
Add Tracestate into SpanContext. (#1359)
* Add Tracestate into SpanContext.
* Remove empty constructor from Tracestate.Builder
* Add info in the changelog.
Diffstat (limited to 'impl_core/src/main/java/io/opencensus/implcore/trace/propagation/BinaryFormatImpl.java')
-rw-r--r-- | impl_core/src/main/java/io/opencensus/implcore/trace/propagation/BinaryFormatImpl.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/impl_core/src/main/java/io/opencensus/implcore/trace/propagation/BinaryFormatImpl.java b/impl_core/src/main/java/io/opencensus/implcore/trace/propagation/BinaryFormatImpl.java index a2438008..1af24854 100644 --- a/impl_core/src/main/java/io/opencensus/implcore/trace/propagation/BinaryFormatImpl.java +++ b/impl_core/src/main/java/io/opencensus/implcore/trace/propagation/BinaryFormatImpl.java @@ -23,6 +23,7 @@ import io.opencensus.trace.SpanContext; import io.opencensus.trace.SpanId; import io.opencensus.trace.TraceId; import io.opencensus.trace.TraceOptions; +import io.opencensus.trace.Tracestate; import io.opencensus.trace.propagation.BinaryFormat; import io.opencensus.trace.propagation.SpanContextParseException; @@ -61,6 +62,7 @@ import io.opencensus.trace.propagation.SpanContextParseException; * </ul> */ final class BinaryFormatImpl extends BinaryFormat { + private static final Tracestate TRACESTATE_DEFAULT = Tracestate.builder().build(); private static final byte VERSION_ID = 0; private static final int VERSION_ID_OFFSET = 0; // The version_id/field_id size in bytes. @@ -141,6 +143,6 @@ final class BinaryFormatImpl extends BinaryFormat { } traceOptions = TraceOptions.fromBytes(bytes, pos + ID_SIZE); } - return SpanContext.create(traceId, spanId, traceOptions); + return SpanContext.create(traceId, spanId, traceOptions, TRACESTATE_DEFAULT); } } |