use of io.jaegertracing.Configuration.ReporterConfiguration in project jaeger-client-java by jaegertracing.
the class ConfigurationTest method testReporterConfiguration.
@Test
public void testReporterConfiguration() {
System.setProperty(Configuration.JAEGER_REPORTER_LOG_SPANS, "true");
System.setProperty(Configuration.JAEGER_AGENT_HOST, "MyHost");
System.setProperty(Configuration.JAEGER_AGENT_PORT, "1234");
System.setProperty(Configuration.JAEGER_REPORTER_FLUSH_INTERVAL, "500");
System.setProperty(Configuration.JAEGER_REPORTER_MAX_QUEUE_SIZE, "1000");
ReporterConfiguration reporterConfig = ReporterConfiguration.fromEnv();
assertTrue(reporterConfig.getLogSpans());
assertEquals("MyHost", reporterConfig.getSenderConfiguration().getAgentHost());
assertEquals(1234, reporterConfig.getSenderConfiguration().getAgentPort().intValue());
assertEquals(500, reporterConfig.getFlushIntervalMs().intValue());
assertEquals(1000, reporterConfig.getMaxQueueSize().intValue());
}
use of io.jaegertracing.Configuration.ReporterConfiguration 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.ReporterConfiguration 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.ReporterConfiguration in project jaeger-client-java by jaegertracing.
the class ConfigurationTest method testReporterConfigurationInvalidFlushInterval.
@Test
public void testReporterConfigurationInvalidFlushInterval() {
System.setProperty(Configuration.JAEGER_REPORTER_FLUSH_INTERVAL, "X");
ReporterConfiguration reporterConfig = ReporterConfiguration.fromEnv();
assertNull(reporterConfig.getFlushIntervalMs());
}
use of io.jaegertracing.Configuration.ReporterConfiguration in project jaeger-client-java by jaegertracing.
the class ConfigurationTest method testReporterConfigurationInvalidLogSpans.
@Test
public void testReporterConfigurationInvalidLogSpans() {
System.setProperty(Configuration.JAEGER_REPORTER_LOG_SPANS, "X");
ReporterConfiguration reporterConfig = ReporterConfiguration.fromEnv();
assertFalse(reporterConfig.getLogSpans());
}
Aggregations