use of com.uber.jaeger.samplers.Sampler 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;
}
use of com.uber.jaeger.samplers.Sampler in project jaeger-client-java by jaegertracing.
the class ConfigurationTest method testProbabilisticSampler.
@Test
public void testProbabilisticSampler() {
SamplerConfiguration samplerConfiguration = new SamplerConfiguration().withType(ProbabilisticSampler.TYPE);
Sampler sampler = samplerConfiguration.createSampler("name", new Metrics(new StatsFactoryImpl(new NullStatsReporter())));
assertTrue(sampler instanceof ProbabilisticSampler);
}
Aggregations