Search in sources :

Example 1 with Reporter

use of io.jaegertracing.spi.Reporter in project jaeger-client-java by jaegertracing.

the class Configuration method getTracerBuilder.

public JaegerTracer.Builder getTracerBuilder() {
    if (reporterConfig == null) {
        reporterConfig = new ReporterConfiguration();
    }
    if (samplerConfig == null) {
        samplerConfig = new SamplerConfiguration();
    }
    if (codecConfig == null) {
        codecConfig = new CodecConfiguration();
    }
    if (metricsFactory == null) {
        metricsFactory = loadMetricsFactory();
    }
    Metrics metrics = new Metrics(metricsFactory);
    Reporter reporter = reporterConfig.getReporter(metrics);
    Sampler sampler = samplerConfig.createSampler(serviceName, metrics);
    JaegerTracer.Builder builder = createTracerBuilder(serviceName).withSampler(sampler).withReporter(reporter).withMetrics(metrics).withTags(tracerTags);
    if (useTraceId128Bit) {
        builder = builder.withTraceId128Bit();
    }
    codecConfig.apply(builder);
    return builder;
}
Also used : Metrics(io.jaegertracing.internal.metrics.Metrics) Reporter(io.jaegertracing.spi.Reporter) CompositeReporter(io.jaegertracing.internal.reporters.CompositeReporter) RemoteReporter(io.jaegertracing.internal.reporters.RemoteReporter) LoggingReporter(io.jaegertracing.internal.reporters.LoggingReporter) Sampler(io.jaegertracing.spi.Sampler) RateLimitingSampler(io.jaegertracing.internal.samplers.RateLimitingSampler) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) ProbabilisticSampler(io.jaegertracing.internal.samplers.ProbabilisticSampler) RemoteControlledSampler(io.jaegertracing.internal.samplers.RemoteControlledSampler) JaegerTracer(io.jaegertracing.internal.JaegerTracer)

Example 2 with Reporter

use of io.jaegertracing.spi.Reporter in project jaeger-client-java by jaegertracing.

the class JaegerTracerTest method testClose.

@Test
public void testClose() {
    Reporter reporter = mock(Reporter.class);
    Sampler sampler = mock(Sampler.class);
    tracer = new JaegerTracer.Builder("bonda").withReporter(reporter).withSampler(sampler).build();
    tracer.close();
    verify(reporter).close();
    verify(sampler).close();
}
Also used : Reporter(io.jaegertracing.spi.Reporter) RemoteReporter(io.jaegertracing.internal.reporters.RemoteReporter) InMemoryReporter(io.jaegertracing.internal.reporters.InMemoryReporter) Sampler(io.jaegertracing.spi.Sampler) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) Builder(io.jaegertracing.internal.JaegerTracer.Builder) Test(org.junit.Test)

Aggregations

RemoteReporter (io.jaegertracing.internal.reporters.RemoteReporter)2 ConstSampler (io.jaegertracing.internal.samplers.ConstSampler)2 Reporter (io.jaegertracing.spi.Reporter)2 Sampler (io.jaegertracing.spi.Sampler)2 JaegerTracer (io.jaegertracing.internal.JaegerTracer)1 Builder (io.jaegertracing.internal.JaegerTracer.Builder)1 Metrics (io.jaegertracing.internal.metrics.Metrics)1 CompositeReporter (io.jaegertracing.internal.reporters.CompositeReporter)1 InMemoryReporter (io.jaegertracing.internal.reporters.InMemoryReporter)1 LoggingReporter (io.jaegertracing.internal.reporters.LoggingReporter)1 ProbabilisticSampler (io.jaegertracing.internal.samplers.ProbabilisticSampler)1 RateLimitingSampler (io.jaegertracing.internal.samplers.RateLimitingSampler)1 RemoteControlledSampler (io.jaegertracing.internal.samplers.RemoteControlledSampler)1 Test (org.junit.Test)1