use of io.jaegertracing.internal.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.
the class JaegerThriftSpanConverterTest method setUp.
@Before
public void setUp() {
final JaegerTracer.Builder tracerBuilder = new JaegerTracer.Builder("test-service-name").withReporter(new InMemoryReporter()).withSampler(new ConstSampler(true));
tracer = tracerBuilder.build();
tracer128 = tracerBuilder.withTraceId128Bit().build();
}
use of io.jaegertracing.internal.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.
the class EndToEndBehaviorResourceTest method setUp.
@Before
public void setUp() throws Exception {
reporter = new InMemoryReporter();
Tracer tracer = new JaegerTracer.Builder("crossdock-java").withReporter(reporter).withSampler(new ConstSampler(true)).build();
Map<String, Tracer> tracers = new HashMap<>();
tracers.put("const", tracer);
resource = new EndToEndBehaviorResource(new EndToEndBehavior(tracers));
}
use of io.jaegertracing.internal.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.
the class JaegerTracerTagsTest method testTracerTags.
@Test
public void testTracerTags() {
InMemoryReporter spanReporter = new InMemoryReporter();
JaegerTracer tracer = new JaegerTracer.Builder("x").withReporter(spanReporter).withSampler(new ConstSampler(true)).withZipkinSharedRpcSpan().withTag("tracer.tag.str", "y").build();
JaegerSpan jaegerSpan = tracer.buildSpan("root").start();
// span should only contain sampler tags and no tracer tags
assertEquals(2, jaegerSpan.getTags().size());
assertEquals(true, jaegerSpan.getTags().containsKey("sampler.type"));
assertEquals(true, jaegerSpan.getTags().containsKey("sampler.param"));
assertEquals(false, jaegerSpan.getTags().containsKey("tracer.tag.str"));
}
use of io.jaegertracing.internal.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.
the class JaegerTracerTagsTest method testEmptyDeclaredIpTag.
@Test
public void testEmptyDeclaredIpTag() {
InMemoryReporter spanReporter = new InMemoryReporter();
String ip = "";
JaegerTracer tracer = new JaegerTracer.Builder("x").withReporter(spanReporter).withTag(Constants.TRACER_IP_TAG_KEY, ip).build();
assertEquals(0, tracer.getIpv4());
}
use of io.jaegertracing.internal.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.
the class JaegerTracerTagsTest method testDeclaredHostTags.
@Test
public void testDeclaredHostTags() {
InMemoryReporter spanReporter = new InMemoryReporter();
String hostname = "myhost";
String ip = "1.1.1.1";
JaegerTracer tracer = new JaegerTracer.Builder("x").withReporter(spanReporter).withTag(Constants.TRACER_HOSTNAME_TAG_KEY, hostname).withTag(Constants.TRACER_IP_TAG_KEY, ip).build();
assertEquals(hostname, tracer.tags().get(Constants.TRACER_HOSTNAME_TAG_KEY));
assertEquals(ip, tracer.tags().get(Constants.TRACER_IP_TAG_KEY));
assertEquals(Utils.ipToInt(ip), tracer.getIpv4());
}
Aggregations