Search in sources :

Example 21 with SpanContext

use of io.opencensus.trace.SpanContext in project instrumentation-java by census-instrumentation.

the class BinaryFormatImplTest method testSpanContextConversion.

private void testSpanContextConversion(SpanContext spanContext) throws SpanContextParseException {
    SpanContext propagatedBinarySpanContext = binaryFormat.fromByteArray(binaryFormat.toByteArray(spanContext));
    assertWithMessage("BinaryFormat propagated context is not equal with the initial context.").that(propagatedBinarySpanContext).isEqualTo(spanContext);
}
Also used : SpanContext(io.opencensus.trace.SpanContext)

Aggregations

SpanContext (io.opencensus.trace.SpanContext)21 Test (org.junit.Test)8 Timestamp (io.opencensus.common.Timestamp)6 AttributeValue (io.opencensus.trace.AttributeValue)4 Status (io.opencensus.trace.Status)4 SpanData (io.opencensus.trace.export.SpanData)4 Span (io.opencensus.trace.Span)3 SpanId (io.opencensus.trace.SpanId)3 ArrayList (java.util.ArrayList)3 CloudTraceContext (com.google.apphosting.api.CloudTraceContext)2 Context (io.grpc.Context)2 Annotation (io.opencensus.trace.Annotation)2 SpanBuilder (io.opencensus.trace.SpanBuilder)2 Map (java.util.Map)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 Span (com.google.devtools.cloudtrace.v2.Span)1 SpanName (com.google.devtools.cloudtrace.v2.SpanName)1 TruncatableString (com.google.devtools.cloudtrace.v2.TruncatableString)1 Metadata (io.grpc.Metadata)1 ServerStreamTracer (io.grpc.ServerStreamTracer)1