Search in sources :

Example 1 with TraceData

use of com.github.kristofa.brave.TraceData in project jaeger-client-java by jaegertracing.

the class B3TextMapCodecTest method testInject_unsampled.

@Test
public void testInject_unsampled() throws Exception {
    DelegatingTextMap textMap = new DelegatingTextMap();
    b3Codec.inject(new SpanContext(1, 1, 0, (byte) 0), textMap);
    TraceData data = takeRequestFromTextMap(textMap);
    assertEquals(Boolean.FALSE, data.getSample());
}
Also used : SpanContext(com.uber.jaeger.SpanContext) TraceData(com.github.kristofa.brave.TraceData) Test(org.junit.Test)

Example 2 with TraceData

use of com.github.kristofa.brave.TraceData in project jaeger-client-java by jaegertracing.

the class B3TextMapCodecTest method testInject_rootSpan.

@Test
public void testInject_rootSpan() throws Exception {
    DelegatingTextMap textMap = new DelegatingTextMap();
    b3Codec.inject(new SpanContext(1, 1, 0, SAMPLED), textMap);
    TraceData data = takeRequestFromTextMap(textMap);
    assertEquals(1, data.getSpanId().traceId);
    assertEquals(null, data.getSpanId().nullableParentId());
    assertEquals(1, data.getSpanId().spanId);
    assertEquals(Boolean.TRUE, data.getSample());
}
Also used : SpanContext(com.uber.jaeger.SpanContext) TraceData(com.github.kristofa.brave.TraceData) Test(org.junit.Test)

Example 3 with TraceData

use of com.github.kristofa.brave.TraceData in project jaeger-client-java by jaegertracing.

the class B3TextMapCodecTest method testInject_childSpan.

@Test
public void testInject_childSpan() throws Exception {
    DelegatingTextMap textMap = new DelegatingTextMap();
    b3Codec.inject(new SpanContext(1, 2, 1, SAMPLED), textMap);
    TraceData data = takeRequestFromTextMap(textMap);
    assertEquals(1, data.getSpanId().traceId);
    assertEquals(Long.valueOf(1), data.getSpanId().nullableParentId());
    assertEquals(2, data.getSpanId().spanId);
    assertEquals(Boolean.TRUE, data.getSample());
}
Also used : SpanContext(com.uber.jaeger.SpanContext) TraceData(com.github.kristofa.brave.TraceData) Test(org.junit.Test)

Aggregations

TraceData (com.github.kristofa.brave.TraceData)3 SpanContext (com.uber.jaeger.SpanContext)3 Test (org.junit.Test)3