Search in sources :

Example 1 with InMemoryReporter

use of io.jaegertracing.internal.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.

the class RemovedFrom032Test method setUp.

@Before
public void setUp() {
    reporter = new InMemoryReporter();
    tracer = new JaegerTracer.Builder("TracerTestService").withReporter(reporter).withSampler(new ConstSampler(true)).build();
}
Also used : InMemoryReporter(io.jaegertracing.internal.reporters.InMemoryReporter) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) Before(org.junit.Before)

Example 2 with InMemoryReporter

use of io.jaegertracing.internal.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.

the class TraceContextCodecTest method testDebugIdWithoutTraceHeader.

@Test
public void testDebugIdWithoutTraceHeader() {
    Map<String, String> extractCarrier = new HashMap<>();
    TextMapAdapter textMap = new TextMapAdapter(extractCarrier);
    textMap.put(Constants.DEBUG_ID_HEADER_KEY, EXAMPLE_DEBUG_ID);
    JaegerSpanContext spanContext = traceContextCodec.extract(textMap);
    JaegerTracer tracer = new JaegerTracer.Builder("service").withReporter(new InMemoryReporter()).build();
    JaegerSpan child = tracer.buildSpan("span").asChildOf(spanContext).start();
    assertTrue(child.context().isDebug());
    child.finish();
    tracer.close();
}
Also used : InMemoryReporter(io.jaegertracing.internal.reporters.InMemoryReporter) HashMap(java.util.HashMap) JaegerSpan(io.jaegertracing.internal.JaegerSpan) TextMapAdapter(io.opentracing.propagation.TextMapAdapter) JaegerSpanContext(io.jaegertracing.internal.JaegerSpanContext) JaegerTracer(io.jaegertracing.internal.JaegerTracer) Test(org.junit.Test)

Example 3 with InMemoryReporter

use of io.jaegertracing.internal.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.

the class ActiveSpanTest method setUp.

@Before
public void setUp() {
    reporter = new InMemoryReporter();
    tracer = new JaegerTracer.Builder("TracerTestService").withReporter(reporter).withSampler(new ConstSampler(true)).build();
}
Also used : InMemoryReporter(io.jaegertracing.internal.reporters.InMemoryReporter) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) Before(org.junit.Before)

Example 4 with InMemoryReporter

use of io.jaegertracing.internal.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.

the class JaegerSpanTest method setUp.

@Before
public void setUp() {
    metricsFactory = new InMemoryMetricsFactory();
    reporter = new InMemoryReporter();
    clock = mock(Clock.class);
    metrics = new Metrics(metricsFactory);
    final JaegerTracer.Builder tracerBuilder = new JaegerTracer.Builder("SamplerTest").withReporter(reporter).withSampler(new ConstSampler(true)).withMetrics(metrics).withClock(clock).withBaggageRestrictionManager(new DefaultBaggageRestrictionManager()).withExpandExceptionLogs();
    tracer = tracerBuilder.build();
    tracer128 = tracerBuilder.withTraceId128Bit().build();
    jaegerSpan = tracer.buildSpan("some-operation").start();
}
Also used : InMemoryReporter(io.jaegertracing.internal.reporters.InMemoryReporter) InMemoryMetricsFactory(io.jaegertracing.internal.metrics.InMemoryMetricsFactory) Metrics(io.jaegertracing.internal.metrics.Metrics) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) Clock(io.jaegertracing.internal.clock.Clock) DefaultBaggageRestrictionManager(io.jaegertracing.internal.baggage.DefaultBaggageRestrictionManager) Before(org.junit.Before)

Example 5 with InMemoryReporter

use of io.jaegertracing.internal.reporters.InMemoryReporter in project jaeger-client-java by jaegertracing.

the class NoopMetricsFactoryTest method canBeUsedWithMetrics.

@Test
public void canBeUsedWithMetrics() {
    NoopMetricsFactory metricsFactory = new NoopMetricsFactory();
    JaegerTracer tracer = new JaegerTracer.Builder("metricsFactoryTest").withReporter(new InMemoryReporter()).withSampler(new ConstSampler(true)).withMetrics(new Metrics(metricsFactory)).build();
    tracer.buildSpan("theoperation").start();
}
Also used : InMemoryReporter(io.jaegertracing.internal.reporters.InMemoryReporter) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) JaegerTracer(io.jaegertracing.internal.JaegerTracer) Test(org.junit.Test)

Aggregations

InMemoryReporter (io.jaegertracing.internal.reporters.InMemoryReporter)29 ConstSampler (io.jaegertracing.internal.samplers.ConstSampler)22 JaegerTracer (io.jaegertracing.internal.JaegerTracer)19 Test (org.junit.Test)17 Before (org.junit.Before)12 JaegerSpan (io.jaegertracing.internal.JaegerSpan)7 InMemoryMetricsFactory (io.jaegertracing.internal.metrics.InMemoryMetricsFactory)6 Metrics (io.jaegertracing.internal.metrics.Metrics)5 HashMap (java.util.HashMap)5 Builder (io.jaegertracing.internal.JaegerTracer.Builder)3 TextMap (io.opentracing.propagation.TextMap)3 UseDataProvider (com.tngtech.java.junit.dataprovider.UseDataProvider)2 JaegerSpanContext (io.jaegertracing.internal.JaegerSpanContext)2 TextMapAdapter (io.opentracing.propagation.TextMapAdapter)2 Map (java.util.Map)2 TreeMap (java.util.TreeMap)2 BinaryAnnotation (com.twitter.zipkin.thriftjava.BinaryAnnotation)1 EndToEndBehavior (io.jaegertracing.crossdock.resources.behavior.EndToEndBehavior)1 DefaultBaggageRestrictionManager (io.jaegertracing.internal.baggage.DefaultBaggageRestrictionManager)1 Clock (io.jaegertracing.internal.clock.Clock)1