use of io.jaegertracing.Configuration.SamplerConfiguration in project jaeger-client-java by jaegertracing.
the class ConfigurationTest method testUnknownSampler.
@Test(expected = IllegalStateException.class)
public void testUnknownSampler() {
SamplerConfiguration samplerConfiguration = new SamplerConfiguration();
samplerConfiguration.withType("unknown");
new Configuration("name").withSampler(samplerConfiguration).getTracer();
}
use of io.jaegertracing.Configuration.SamplerConfiguration 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);
}
use of io.jaegertracing.Configuration.SamplerConfiguration in project jaeger-client-java by jaegertracing.
the class ConfigurationTest method testRateLimitingSampler.
@Test
public void testRateLimitingSampler() {
SamplerConfiguration samplerConfiguration = new SamplerConfiguration().withType(RateLimitingSampler.TYPE);
Sampler sampler = samplerConfiguration.createSampler("name", new Metrics(new InMemoryMetricsFactory()));
assertTrue(sampler instanceof RateLimitingSampler);
}
use of io.jaegertracing.Configuration.SamplerConfiguration in project jaeger-client-java by jaegertracing.
the class JerseyServer method main.
public static void main(String[] args) throws Exception {
BasicConfigurator.configure();
String serviceName = serviceNameFromEnv();
Configuration configuration = new Configuration(serviceName).withSampler(new SamplerConfiguration().withType(ConstSampler.TYPE).withParam(0)).withReporter(new ReporterConfiguration().withLogSpans(true));
JerseyServer server = new JerseyServer("0.0.0.0", 8081, configuration, Arrays.asList(new TraceBehaviorResource(configuration.getTracer()), new EndToEndBehaviorResource(new EndToEndBehavior(getEvn(SAMPLING_HOST_PORT, "jaeger-agent:5778"), "crossdock-" + serviceName, senderFromEnv(getEvn(COLLECTOR_HOST_PORT, "jaeger-collector:14268"), getEvn(AGENT_HOST, "jaeger-agent")))), new HealthResource()));
server.addNetworkListener(new NetworkListener("health", "0.0.0.0", 8080));
Thread.currentThread().join();
}
Aggregations