Search in sources :

Example 1 with ProbabilisticSampler

use of com.uber.jaeger.samplers.ProbabilisticSampler in project jaeger-client-java by jaegertracing.

the class EndToEndBehavior method getRemoteTracer.

private Tracer getRemoteTracer(Metrics metrics, Reporter reporter, String serviceName, String samplingHostPort) {
    Sampler initialSampler = new ProbabilisticSampler(1.0);
    HttpSamplingManager manager = new HttpSamplingManager(samplingHostPort);
    RemoteControlledSampler remoteSampler = new RemoteControlledSampler(serviceName, manager, initialSampler, metrics, 5000);
    com.uber.jaeger.Tracer.Builder remoteTracerBuilder = new com.uber.jaeger.Tracer.Builder(serviceName, reporter, remoteSampler);
    return remoteTracerBuilder.build();
}
Also used : HttpSamplingManager(com.uber.jaeger.samplers.HttpSamplingManager) Tracer(io.opentracing.Tracer) RemoteControlledSampler(com.uber.jaeger.samplers.RemoteControlledSampler) Sampler(com.uber.jaeger.samplers.Sampler) ConstSampler(com.uber.jaeger.samplers.ConstSampler) ProbabilisticSampler(com.uber.jaeger.samplers.ProbabilisticSampler) ProbabilisticSampler(com.uber.jaeger.samplers.ProbabilisticSampler) RemoteControlledSampler(com.uber.jaeger.samplers.RemoteControlledSampler)

Example 2 with ProbabilisticSampler

use of com.uber.jaeger.samplers.ProbabilisticSampler 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);
}
Also used : Metrics(com.uber.jaeger.metrics.Metrics) NullStatsReporter(com.uber.jaeger.metrics.NullStatsReporter) RateLimitingSampler(com.uber.jaeger.samplers.RateLimitingSampler) Sampler(com.uber.jaeger.samplers.Sampler) ConstSampler(com.uber.jaeger.samplers.ConstSampler) ProbabilisticSampler(com.uber.jaeger.samplers.ProbabilisticSampler) SamplerConfiguration(com.uber.jaeger.Configuration.SamplerConfiguration) StatsFactoryImpl(com.uber.jaeger.metrics.StatsFactoryImpl) ProbabilisticSampler(com.uber.jaeger.samplers.ProbabilisticSampler) Test(org.junit.Test)

Aggregations

ConstSampler (com.uber.jaeger.samplers.ConstSampler)2 ProbabilisticSampler (com.uber.jaeger.samplers.ProbabilisticSampler)2 Sampler (com.uber.jaeger.samplers.Sampler)2 SamplerConfiguration (com.uber.jaeger.Configuration.SamplerConfiguration)1 Metrics (com.uber.jaeger.metrics.Metrics)1 NullStatsReporter (com.uber.jaeger.metrics.NullStatsReporter)1 StatsFactoryImpl (com.uber.jaeger.metrics.StatsFactoryImpl)1 HttpSamplingManager (com.uber.jaeger.samplers.HttpSamplingManager)1 RateLimitingSampler (com.uber.jaeger.samplers.RateLimitingSampler)1 RemoteControlledSampler (com.uber.jaeger.samplers.RemoteControlledSampler)1 Tracer (io.opentracing.Tracer)1 Test (org.junit.Test)1