use of io.jaegertracing.internal.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.
the class JaegerTracerTest method setUp.
@Before
public void setUp() {
metricsFactory = new InMemoryMetricsFactory();
tracer = new JaegerTracer.Builder("TracerTestService").withReporter(new InMemoryReporter()).withSampler(new ConstSampler(true)).withMetrics(new Metrics(metricsFactory)).build();
}
use of io.jaegertracing.internal.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.
the class JaegerTracerTest method testWithBaggageRestrictionManager.
@Test
public void testWithBaggageRestrictionManager() {
tracer = new JaegerTracer.Builder("TracerTestService").withReporter(new InMemoryReporter()).withSampler(new ConstSampler(true)).withMetrics(new Metrics(metricsFactory)).build();
JaegerSpan span = tracer.buildSpan("some-operation").start();
final String key = "key";
tracer.setBaggage(span, key, "value");
assertEquals(1, metricsFactory.getCounter("jaeger_tracer_baggage_updates", "result=ok"));
}
use of io.jaegertracing.internal.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.
the class JaegerTracerTest method testRegisterInjector.
@Test
public void testRegisterInjector() {
@SuppressWarnings("unchecked") Injector<TextMap> injector = mock(Injector.class);
JaegerTracer tracer = new JaegerTracer.Builder("TracerTestService").withReporter(new InMemoryReporter()).withSampler(new ConstSampler(true)).withMetrics(new Metrics(new InMemoryMetricsFactory())).registerInjector(Format.Builtin.TEXT_MAP, injector).build();
JaegerSpan span = tracer.buildSpan("leela").start();
TextMap carrier = mock(TextMap.class);
tracer.inject(span.context(), Format.Builtin.TEXT_MAP, carrier);
verify(injector).inject(any(JaegerSpanContext.class), any(TextMap.class));
}
use of io.jaegertracing.internal.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.
the class BaggageSetterTest method setUp.
@Before
public void setUp() {
metricsFactory = new InMemoryMetricsFactory();
reporter = new InMemoryReporter();
metrics = new Metrics(metricsFactory);
mgr = mock(DefaultBaggageRestrictionManager.class);
setter = new BaggageSetter(mgr, metrics);
tracer = new JaegerTracer.Builder(SERVICE).withReporter(reporter).withSampler(new ConstSampler(true)).withMetrics(metrics).build();
jaegerSpan = tracer.buildSpan("some-operation").start();
}
Aggregations