Search in sources :

Example 16 with InMemoryReporter

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

the class MDCScopeManagerTest method setUp.

@Before
public void setUp() {
    reporter = new InMemoryReporter();
    defaultTracer = createTracer(new MDCScopeManager.Builder().build());
}
Also used : InMemoryReporter(io.jaegertracing.internal.reporters.InMemoryReporter) Before(org.junit.Before)

Example 17 with InMemoryReporter

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

the class ActiveSpanTest method testCustomScopeManager.

@Test
public void testCustomScopeManager() {
    Span span = mock(Span.class);
    Scope scope = mock(Scope.class);
    JaegerTracer tracer = new JaegerTracer.Builder("test").withReporter(new InMemoryReporter()).withSampler(new ConstSampler(true)).withScopeManager(new ScopeManager() {

        @Override
        public Scope activate(Span span) {
            return scope;
        }

        @Override
        public Span activeSpan() {
            return span;
        }
    }).build();
    assertEquals(span, tracer.scopeManager().activeSpan());
    assertEquals(scope, tracer.scopeManager().activate(span));
}
Also used : InMemoryReporter(io.jaegertracing.internal.reporters.InMemoryReporter) ScopeManager(io.opentracing.ScopeManager) Scope(io.opentracing.Scope) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) Span(io.opentracing.Span) Test(org.junit.Test)

Example 18 with InMemoryReporter

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

the class UdpSenderTest method setUp.

@Before
public void setUp() throws Exception {
    server = startServer();
    reporter = new InMemoryReporter();
    final JaegerTracer.Builder tracerBuilder = new JaegerTracer.Builder(SERVICE_NAME).withReporter(reporter).withSampler(new ConstSampler(true)).withMetricsFactory(new InMemoryMetricsFactory()).withTag("foo", "bar");
    tracer = tracerBuilder.build();
    tracer128 = tracerBuilder.withTraceId128Bit().build();
    sender = new UdpSender(destHost, destPort, maxPacketSize);
}
Also used : InMemoryReporter(io.jaegertracing.internal.reporters.InMemoryReporter) InMemoryMetricsFactory(io.jaegertracing.internal.metrics.InMemoryMetricsFactory) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) JaegerTracer(io.jaegertracing.internal.JaegerTracer) Before(org.junit.Before)

Example 19 with InMemoryReporter

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

the class ZipkinSenderTest method setUp.

@Before
public void setUp() {
    reporter = new InMemoryReporter();
    final JaegerTracer.Builder tracerBuilder = new JaegerTracer.Builder("test-sender").withReporter(reporter).withSampler(new ConstSampler(true)).withMetricsFactory(new InMemoryMetricsFactory());
    tracer = tracerBuilder.build();
    tracer128 = tracerBuilder.withTraceId128Bit().build();
    sender = newSender(messageMaxBytes);
    converter = new ThriftSpanConverter();
}
Also used : InMemoryReporter(io.jaegertracing.internal.reporters.InMemoryReporter) InMemoryMetricsFactory(io.jaegertracing.internal.metrics.InMemoryMetricsFactory) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) ThriftSpanConverter(io.jaegertracing.zipkin.internal.ThriftSpanConverter) JaegerTracer(io.jaegertracing.internal.JaegerTracer) Before(org.junit.Before)

Example 20 with InMemoryReporter

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

the class V2SpanConverterTest method setUp.

@Before
public void setUp() {
    final JaegerTracer.Builder tracerBuilder = new JaegerTracer.Builder("test-service-name").withReporter(new InMemoryReporter()).withSampler(new ConstSampler(true)).withZipkinSharedRpcSpan();
    tracer = tracerBuilder.build();
    tracer128 = tracerBuilder.withTraceId128Bit().build();
}
Also used : InMemoryReporter(io.jaegertracing.internal.reporters.InMemoryReporter) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) JaegerTracer(io.jaegertracing.internal.JaegerTracer) Before(org.junit.Before)

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