Search in sources :

Example 1 with ProbabilisticSampler

use of io.jaegertracing.internal.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.Builder(serviceName).withSamplingManager(manager).withInitialSampler(initialSampler).withMetrics(metrics).withPollingInterval(5000).build();
    return new JaegerTracer.Builder(serviceName).withReporter(reporter).withSampler(remoteSampler).build();
}
Also used : HttpSamplingManager(io.jaegertracing.internal.samplers.HttpSamplingManager) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) ProbabilisticSampler(io.jaegertracing.internal.samplers.ProbabilisticSampler) RemoteControlledSampler(io.jaegertracing.internal.samplers.RemoteControlledSampler) Sampler(io.jaegertracing.spi.Sampler) ProbabilisticSampler(io.jaegertracing.internal.samplers.ProbabilisticSampler) RemoteControlledSampler(io.jaegertracing.internal.samplers.RemoteControlledSampler) JaegerTracer(io.jaegertracing.internal.JaegerTracer)

Example 2 with ProbabilisticSampler

use of io.jaegertracing.internal.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 InMemoryMetricsFactory()));
    assertTrue(sampler instanceof ProbabilisticSampler);
}
Also used : Metrics(io.jaegertracing.internal.metrics.Metrics) InMemoryMetricsFactory(io.jaegertracing.internal.metrics.InMemoryMetricsFactory) Sampler(io.jaegertracing.spi.Sampler) RateLimitingSampler(io.jaegertracing.internal.samplers.RateLimitingSampler) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) ProbabilisticSampler(io.jaegertracing.internal.samplers.ProbabilisticSampler) SamplerConfiguration(io.jaegertracing.Configuration.SamplerConfiguration) ProbabilisticSampler(io.jaegertracing.internal.samplers.ProbabilisticSampler) Test(org.junit.Test)

Aggregations

ConstSampler (io.jaegertracing.internal.samplers.ConstSampler)2 ProbabilisticSampler (io.jaegertracing.internal.samplers.ProbabilisticSampler)2 Sampler (io.jaegertracing.spi.Sampler)2 SamplerConfiguration (io.jaegertracing.Configuration.SamplerConfiguration)1 JaegerTracer (io.jaegertracing.internal.JaegerTracer)1 InMemoryMetricsFactory (io.jaegertracing.internal.metrics.InMemoryMetricsFactory)1 Metrics (io.jaegertracing.internal.metrics.Metrics)1 HttpSamplingManager (io.jaegertracing.internal.samplers.HttpSamplingManager)1 RateLimitingSampler (io.jaegertracing.internal.samplers.RateLimitingSampler)1 RemoteControlledSampler (io.jaegertracing.internal.samplers.RemoteControlledSampler)1 Test (org.junit.Test)1