use of com.uber.jaeger.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.
the class TracerTagsTest method testEmptyDeclaredIpTag.
@Test
public void testEmptyDeclaredIpTag() throws Exception {
InMemoryReporter spanReporter = new InMemoryReporter();
String ip = "";
Tracer tracer = new Tracer.Builder("x").withReporter(spanReporter).withTag(Constants.TRACER_IP_TAG_KEY, ip).build();
assertEquals(0, tracer.getIpv4());
}
use of com.uber.jaeger.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.
the class TracerTagsTest method testShortDeclaredIpTag.
@Test
public void testShortDeclaredIpTag() throws Exception {
InMemoryReporter spanReporter = new InMemoryReporter();
String ip = ":19";
Tracer tracer = new Tracer.Builder("x").withReporter(spanReporter).withTag(Constants.TRACER_IP_TAG_KEY, ip).build();
assertEquals(0, tracer.getIpv4());
}
use of com.uber.jaeger.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.
the class TracerTest method testRegisterInjector.
@Test
public void testRegisterInjector() {
@SuppressWarnings("unchecked") Injector<TextMap> injector = mock(Injector.class);
Tracer tracer = new Tracer.Builder("TracerTestService", new InMemoryReporter(), new ConstSampler(true)).withMetrics(new Metrics(new InMemoryMetricsFactory())).registerInjector(Format.Builtin.TEXT_MAP, injector).build();
Span span = (Span) tracer.buildSpan("leela").start();
TextMap carrier = mock(TextMap.class);
tracer.inject(span.context(), Format.Builtin.TEXT_MAP, carrier);
verify(injector).inject(any(SpanContext.class), any(TextMap.class));
}
use of com.uber.jaeger.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.
the class TracerTest method setUp.
@Before
public void setUp() throws Exception {
metricsFactory = new InMemoryMetricsFactory();
tracer = new Tracer.Builder("TracerTestService").withReporter(new InMemoryReporter()).withSampler(new ConstSampler(true)).withMetrics(new Metrics(metricsFactory)).build();
}
use of com.uber.jaeger.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.
the class TracerTest method testWithBaggageRestrictionManager.
@Test
public void testWithBaggageRestrictionManager() {
tracer = new Tracer.Builder("TracerTestService", new InMemoryReporter(), new ConstSampler(true)).withMetrics(new Metrics(metricsFactory)).build();
Span span = (Span) tracer.buildSpan("some-operation").start();
final String key = "key";
tracer.setBaggage(span, key, "value");
assertEquals(1, metricsFactory.getCounter("jaeger:baggage_updates", "result=ok"));
}
Aggregations