Search in sources :

Example 1 with Reporter

use of com.uber.jaeger.reporters.Reporter in project jaeger-client-java by jaegertracing.

the class TracerTest method testClose.

@Test
public void testClose() {
    Reporter reporter = mock(Reporter.class);
    Sampler sampler = mock(Sampler.class);
    tracer = new Tracer.Builder("bonda", reporter, sampler).build();
    tracer.close();
    verify(reporter).close();
    verify(sampler).close();
}
Also used : Reporter(com.uber.jaeger.reporters.Reporter) InMemoryReporter(com.uber.jaeger.reporters.InMemoryReporter) RemoteReporter(com.uber.jaeger.reporters.RemoteReporter) Sampler(com.uber.jaeger.samplers.Sampler) ConstSampler(com.uber.jaeger.samplers.ConstSampler) Builder(com.uber.jaeger.Tracer.Builder) Test(org.junit.Test)

Example 2 with Reporter

use of com.uber.jaeger.reporters.Reporter in project jaeger-client-java by jaegertracing.

the class Configuration method getTracerBuilder.

public Tracer.Builder getTracerBuilder() {
    if (reporterConfig == null) {
        reporterConfig = new ReporterConfiguration();
    }
    if (samplerConfig == null) {
        samplerConfig = new SamplerConfiguration();
    }
    if (codecConfig == null) {
        codecConfig = new CodecConfiguration(Collections.<Format<?>, List<Codec<TextMap>>>emptyMap());
    }
    if (metricsFactory == null) {
        metricsFactory = new NoopMetricsFactory();
    }
    Metrics metrics = new Metrics(metricsFactory);
    Reporter reporter = reporterConfig.getReporter(metrics);
    Sampler sampler = samplerConfig.createSampler(serviceName, metrics);
    Tracer.Builder builder = new Tracer.Builder(serviceName).withSampler(sampler).withReporter(reporter).withMetrics(metrics).withTags(tracerTags);
    codecConfig.apply(builder);
    return builder;
}
Also used : Reporter(com.uber.jaeger.reporters.Reporter) LoggingReporter(com.uber.jaeger.reporters.LoggingReporter) CompositeReporter(com.uber.jaeger.reporters.CompositeReporter) RemoteReporter(com.uber.jaeger.reporters.RemoteReporter) Metrics(com.uber.jaeger.metrics.Metrics) NumberFormat(java.text.NumberFormat) Format(io.opentracing.propagation.Format) RemoteControlledSampler(com.uber.jaeger.samplers.RemoteControlledSampler) RateLimitingSampler(com.uber.jaeger.samplers.RateLimitingSampler) Sampler(com.uber.jaeger.samplers.Sampler) ConstSampler(com.uber.jaeger.samplers.ConstSampler) ProbabilisticSampler(com.uber.jaeger.samplers.ProbabilisticSampler) LinkedList(java.util.LinkedList) List(java.util.List) TextMap(io.opentracing.propagation.TextMap) NoopMetricsFactory(com.uber.jaeger.metrics.NoopMetricsFactory)

Aggregations

RemoteReporter (com.uber.jaeger.reporters.RemoteReporter)2 Reporter (com.uber.jaeger.reporters.Reporter)2 ConstSampler (com.uber.jaeger.samplers.ConstSampler)2 Sampler (com.uber.jaeger.samplers.Sampler)2 Builder (com.uber.jaeger.Tracer.Builder)1 Metrics (com.uber.jaeger.metrics.Metrics)1 NoopMetricsFactory (com.uber.jaeger.metrics.NoopMetricsFactory)1 CompositeReporter (com.uber.jaeger.reporters.CompositeReporter)1 InMemoryReporter (com.uber.jaeger.reporters.InMemoryReporter)1 LoggingReporter (com.uber.jaeger.reporters.LoggingReporter)1 ProbabilisticSampler (com.uber.jaeger.samplers.ProbabilisticSampler)1 RateLimitingSampler (com.uber.jaeger.samplers.RateLimitingSampler)1 RemoteControlledSampler (com.uber.jaeger.samplers.RemoteControlledSampler)1 Format (io.opentracing.propagation.Format)1 TextMap (io.opentracing.propagation.TextMap)1 NumberFormat (java.text.NumberFormat)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Test (org.junit.Test)1