io.opentracing.NoopTracerFactory Java Examples

The following examples show how to use io.opentracing.NoopTracerFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TracingConfiguration.java    From ola with Apache License 2.0 5 votes vote down vote up
@Bean
public Tracer tracer() {
    String jaegerURL = System.getenv("JAEGER_SERVER_HOSTNAME");
    if (jaegerURL != null) {
        log.info("Using Jaeger tracer");
        return jaegerTracer(jaegerURL);
    }

    log.info("Using Noop tracer");
    return NoopTracerFactory.create();
}
 
Example #2
Source File: TracingConfiguration.java    From hola with Apache License 2.0 5 votes vote down vote up
@Produces
@Singleton
public Tracer tracer() {
    String jaegerURL = System.getenv("JAEGER_SERVER_HOSTNAME");
    if (jaegerURL != null) {
        log.info("Using Jaeger tracer");
        return jaegerTracer(jaegerURL);
    }

    log.info("Using Noop tracer");
    return NoopTracerFactory.create();

}
 
Example #3
Source File: BaseOpenTracingHookTest.java    From shardingsphere with Apache License 2.0 5 votes vote down vote up
@AfterClass
@SneakyThrows(ReflectiveOperationException.class)
public static void releaseTracer() {
    Field field = GlobalTracer.class.getDeclaredField("tracer");
    field.setAccessible(true);
    field.set(GlobalTracer.class, NoopTracerFactory.create());
}
 
Example #4
Source File: ShardingTracerTest.java    From shardingsphere with Apache License 2.0 4 votes vote down vote up
@SneakyThrows(ReflectiveOperationException.class)
private static void clearGlobalTracer() {
    Field tracerField = GlobalTracer.class.getDeclaredField("tracer");
    tracerField.setAccessible(true);
    tracerField.set(GlobalTracer.class, NoopTracerFactory.create());
}