use of io.jaegertracing.Configuration.SamplerConfiguration in project cxf by apache.
the class Client method main.
public static void main(final String[] args) throws Exception {
final Tracer tracer = new Configuration("tracer-client").withSampler(new SamplerConfiguration().withType(ConstSampler.TYPE).withParam(1)).withReporter(new ReporterConfiguration().withSender(new SenderConfiguration() {
@Override
public Sender getSender() {
return new Slf4jLogSender();
}
})).getTracer();
final OpenTracingClientProvider provider = new OpenTracingClientProvider(tracer);
final Response response = WebClient.create("http://localhost:9000/catalog", Arrays.asList(provider)).accept(MediaType.APPLICATION_JSON).get();
System.out.println(response.readEntity(String.class));
response.close();
}
use of io.jaegertracing.Configuration.SamplerConfiguration in project jaeger-client-java by jaegertracing.
the class TraceBehaviorResourceTest method setUp.
@Before
public void setUp() throws Exception {
Configuration configuration = new Configuration(SERVICE_NAME).withSampler(new SamplerConfiguration().withType(ConstSampler.TYPE).withParam(0)).withReporter(new ReporterConfiguration().withLogSpans(true));
server = new JerseyServer("127.0.0.1", port, configuration, Collections.singletonList(new TraceBehaviorResource(configuration.getTracer())));
hostPort = String.format("127.0.0.1:%d", port);
behavior = new TraceBehavior(server.getTracer());
}
use of io.jaegertracing.Configuration.SamplerConfiguration in project jaeger-client-java by jaegertracing.
the class ConfigurationTest method testSamplerConstInvalidParam.
@Test
public void testSamplerConstInvalidParam() {
System.setProperty(Configuration.JAEGER_SAMPLER_TYPE, ConstSampler.TYPE);
System.setProperty(Configuration.JAEGER_SAMPLER_PARAM, "X");
SamplerConfiguration samplerConfig = SamplerConfiguration.fromEnv();
assertEquals(ConstSampler.TYPE, samplerConfig.getType());
assertNull(samplerConfig.getParam());
}
use of io.jaegertracing.Configuration.SamplerConfiguration in project jaeger-client-java by jaegertracing.
the class ConfigurationTest method testConstSampler.
@Test
public void testConstSampler() {
SamplerConfiguration samplerConfiguration = new SamplerConfiguration().withType(ConstSampler.TYPE);
Sampler sampler = samplerConfiguration.createSampler("name", new Metrics(new InMemoryMetricsFactory()));
assertTrue(sampler instanceof ConstSampler);
}
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);
}
Aggregations