use of io.jaegertracing.spi.Sender in project jaeger-client-java by jaegertracing.
the class SenderResolverTest method testFromServiceLoader.
@Test
public void testFromServiceLoader() {
CustomSender customSender = new CustomSender();
SenderFactoryToBeLoaded.sender = customSender;
Sender sender = SenderResolver.resolve();
assertEquals(customSender, sender);
}
use of io.jaegertracing.spi.Sender in project jaeger-client-java by jaegertracing.
the class ThriftSenderFactoryTest method testSenderWithEndpointWithoutAuthData.
@Test
public void testSenderWithEndpointWithoutAuthData() {
System.setProperty(Configuration.JAEGER_ENDPOINT, "https://jaeger-collector:14268/api/traces");
Sender sender = Configuration.SenderConfiguration.fromEnv().getSender();
assertTrue(sender instanceof HttpSender);
}
use of io.jaegertracing.spi.Sender in project jaeger-client-java by jaegertracing.
the class ThriftSenderFactoryTest method testSenderWithAgentDataFromEnv.
@Test
public void testSenderWithAgentDataFromEnv() {
System.setProperty(Configuration.JAEGER_AGENT_HOST, "jaeger-agent");
System.setProperty(Configuration.JAEGER_AGENT_PORT, "6832");
Sender sender = Configuration.SenderConfiguration.fromEnv().getSender();
assertTrue(sender instanceof UdpSender);
}
use of io.jaegertracing.spi.Sender 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.spi.Sender in project jaeger-client-java by jaegertracing.
the class SenderResolverTest method testSpecifiedFactoryNotInList.
@Test
public void testSpecifiedFactoryNotInList() throws Exception {
System.setProperty(Configuration.JAEGER_SENDER_FACTORY, "SpecifiedFactory");
SenderFactoryToBeLoaded.sender = new CustomSender();
Sender sender = getSenderForServiceFileContents("\nio.jaegertracing.internal.senders.InMemorySenderFactory", true);
assertTrue(sender instanceof NoopSender);
System.clearProperty(Configuration.JAEGER_SENDER_FACTORY);
}
Aggregations