Search in sources :

Example 1 with Configuration

use of com.uber.jaeger.Configuration in project cxf by apache.

the class OpenTracingTracingTest method setUp.

@Before
public void setUp() {
    random = new Random();
    tracer = new Configuration("tracer", new Configuration.SamplerConfiguration(ConstSampler.TYPE, 1), new Configuration.ReporterConfiguration(new TestSender())).getTracer();
    TestSender.clear();
}
Also used : TestSender(org.apache.cxf.systest.jaeger.TestSender) Random(java.util.Random) Configuration(com.uber.jaeger.Configuration) Before(org.junit.Before)

Example 2 with Configuration

use of com.uber.jaeger.Configuration in project cxf by apache.

the class OpenTracingTracingTest method setUp.

@Before
public void setUp() {
    TestSender.clear();
    tracer = new Configuration("tracer-test-client", new Configuration.SamplerConfiguration(ConstSampler.TYPE, 1), new Configuration.ReporterConfiguration(new TestSender())).getTracer();
    openTracingClientProvider = new OpenTracingClientProvider(tracer);
    random = new Random();
}
Also used : TestSender(org.apache.cxf.systest.jaeger.TestSender) Configuration(com.uber.jaeger.Configuration) Random(java.util.Random) OpenTracingClientProvider(org.apache.cxf.tracing.opentracing.jaxrs.OpenTracingClientProvider) Before(org.junit.Before)

Example 3 with Configuration

use of com.uber.jaeger.Configuration in project jaeger-client-java by jaegertracing.

the class TracingUtilsTest method getTraceContext.

@Test
public void getTraceContext() {
    Tracer tracer = new Configuration("boop").getTracer();
    Assert.assertNotNull(tracer);
    TracingUtils.setTracer(tracer);
    Assert.assertNotNull(TracingUtils.getTraceContext());
}
Also used : Configuration(com.uber.jaeger.Configuration) Tracer(io.opentracing.Tracer) Test(org.junit.Test)

Example 4 with Configuration

use of com.uber.jaeger.Configuration in project jaeger-client-java by jaegertracing.

the class TracingUtilsTest method tracedExecutor.

@Test()
public void tracedExecutor() throws Exception {
    Tracer tracer = new Configuration("boop").getTracer();
    Assert.assertNotNull(tracer);
    TracingUtils.setTracer(tracer);
    Assert.assertNotNull(TracingUtils.tracedExecutor(Executors.newSingleThreadExecutor()));
}
Also used : Configuration(com.uber.jaeger.Configuration) Tracer(io.opentracing.Tracer) Test(org.junit.Test)

Example 5 with Configuration

use of com.uber.jaeger.Configuration in project wildfly-swarm by wildfly-swarm.

the class JaegerInitializer method contextInitialized.

@Override
public void contextInitialized(ServletContextEvent servletContextEvent) {
    ServletContext sc = servletContextEvent.getServletContext();
    String serviceName = getProperty(sc, JAEGER_SERVICE_NAME);
    if (serviceName == null || serviceName.isEmpty()) {
        logger.info("No Service Name set. Skipping initialization of the Jaeger Tracer.");
        return;
    }
    Configuration configuration = new Configuration(getProperty(sc, JAEGER_SERVICE_NAME), new Configuration.SamplerConfiguration(getProperty(sc, JAEGER_SAMPLER_TYPE), getPropertyAsNumber(sc, JAEGER_SAMPLER_PARAM), getProperty(sc, JAEGER_SAMPLER_MANAGER_HOST_PORT)), new ReporterConfiguration(getPropertyAsBoolean(sc, JAEGER_REPORTER_LOG_SPANS), getProperty(sc, JAEGER_AGENT_HOST), getPropertyAsInt(sc, JAEGER_AGENT_PORT), getPropertyAsInt(sc, JAEGER_REPORTER_FLUSH_INTERVAL), getPropertyAsInt(sc, JAEGER_REPORTER_MAX_QUEUE_SIZE)));
    GlobalTracer.register(configuration.getTracer());
}
Also used : Configuration(com.uber.jaeger.Configuration) ServletContext(javax.servlet.ServletContext)

Aggregations

Configuration (com.uber.jaeger.Configuration)5 Tracer (io.opentracing.Tracer)2 Random (java.util.Random)2 TestSender (org.apache.cxf.systest.jaeger.TestSender)2 Before (org.junit.Before)2 Test (org.junit.Test)2 ServletContext (javax.servlet.ServletContext)1 OpenTracingClientProvider (org.apache.cxf.tracing.opentracing.jaxrs.OpenTracingClientProvider)1