cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [cxf] branch master updated: CXF-7762: Upgrade to latest OpenTracing API (0.31.0)
Date Thu, 02 Aug 2018 10:38:58 GMT
This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new 91a3122  CXF-7762: Upgrade to latest OpenTracing API (0.31.0)
91a3122 is described below

commit 91a3122620ecf8ff767f2d769726b6039dbda6d4
Author: reta <drreta@gmail.com>
AuthorDate: Thu Aug 2 06:38:42 2018 -0400

    CXF-7762: Upgrade to latest OpenTracing API (0.31.0)
---
 .../samples/jax_rs/tracing_opentracing/pom.xml     |  2 +-
 .../java/demo/jaxrs/tracing/Slf4jLogSender.java    |  8 +--
 .../java/demo/jaxrs/tracing/client/Client.java     | 24 +++++--
 .../java/demo/jaxrs/tracing/server/Server.java     | 24 +++++--
 .../jax_rs/tracing_opentracing_camel/pom.xml       | 10 ++-
 .../java/demo/jaxrs/tracing/client/Client.java     | 29 ++++----
 .../demo/jaxrs/tracing/server/camel/Server.java    | 43 ++++++------
 .../java/demo/jaxrs/tracing/server/cxf/Server.java | 19 +++--
 .../services/io.jaegertracing.spi.SenderFactory    |  1 +
 .../jax_rs/tracing_opentracing_osgi/README.txt     |  8 +--
 .../jax_rs/tracing_opentracing_osgi/pom.xml        |  8 +--
 .../services/io.jaegertracing.spi.SenderFactory    |  1 +
 .../main/resources/OSGI-INF/blueprint/context.xml  | 62 ++++++++++------
 .../AbstractOpenTracingClientProvider.java         | 43 ++++++------
 .../opentracing/AbstractOpenTracingProvider.java   | 44 ++++++------
 .../tracing/opentracing/OpenTracingContext.java    | 30 ++++----
 .../apache/cxf/tracing/opentracing/TraceScope.java | 18 ++---
 .../jaxrs/OpenTracingContextProvider.java          |  4 +-
 parent/pom.xml                                     |  8 +--
 systests/tracing/pom.xml                           |  2 +-
 .../org/apache/cxf/systest/jaeger/TestSender.java  | 12 ++--
 .../systest/jaxrs/tracing/opentracing/HasSpan.java | 12 ++--
 .../jaxrs/tracing/opentracing/IsLogContaining.java |  4 +-
 .../opentracing/OpenTracingTracingTest.java        | 82 +++++++++++++---------
 .../jaxws/tracing/opentracing/BookStore.java       |  4 +-
 .../opentracing/OpenTracingTracingTest.java        | 51 +++++++++-----
 26 files changed, 323 insertions(+), 230 deletions(-)

diff --git a/distribution/src/main/release/samples/jax_rs/tracing_opentracing/pom.xml b/distribution/src/main/release/samples/jax_rs/tracing_opentracing/pom.xml
index 0769de1..ef31125 100644
--- a/distribution/src/main/release/samples/jax_rs/tracing_opentracing/pom.xml
+++ b/distribution/src/main/release/samples/jax_rs/tracing_opentracing/pom.xml
@@ -128,7 +128,7 @@
             <artifactId>jetty-webapp</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.uber.jaeger</groupId>
+            <groupId>io.jaegertracing</groupId>
             <artifactId>jaeger-core</artifactId>
         </dependency>
     </dependencies>
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_opentracing/src/main/java/demo/jaxrs/tracing/Slf4jLogSender.java b/distribution/src/main/release/samples/jax_rs/tracing_opentracing/src/main/java/demo/jaxrs/tracing/Slf4jLogSender.java
index 1fd3486..d1f74d1 100644
--- a/distribution/src/main/release/samples/jax_rs/tracing_opentracing/src/main/java/demo/jaxrs/tracing/Slf4jLogSender.java
+++ b/distribution/src/main/release/samples/jax_rs/tracing_opentracing/src/main/java/demo/jaxrs/tracing/Slf4jLogSender.java
@@ -19,9 +19,9 @@
 
 package demo.jaxrs.tracing;
 
-import com.uber.jaeger.Span;
-import com.uber.jaeger.exceptions.SenderException;
-import com.uber.jaeger.senders.Sender;
+import io.jaegertracing.internal.JaegerSpan;
+import io.jaegertracing.internal.exceptions.SenderException;
+import io.jaegertracing.spi.Sender;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
 public class Slf4jLogSender implements Sender {
     private static final Logger LOG = LoggerFactory.getLogger(Slf4jLogSender.class);
     @Override
-    public int append(Span span) throws SenderException {
+    public int append(JaegerSpan span) throws SenderException {
         LOG.info("{}", span);
         return 0;
     }
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_opentracing/src/main/java/demo/jaxrs/tracing/client/Client.java b/distribution/src/main/release/samples/jax_rs/tracing_opentracing/src/main/java/demo/jaxrs/tracing/client/Client.java
index b34ec2c..09433ce 100644
--- a/distribution/src/main/release/samples/jax_rs/tracing_opentracing/src/main/java/demo/jaxrs/tracing/client/Client.java
+++ b/distribution/src/main/release/samples/jax_rs/tracing_opentracing/src/main/java/demo/jaxrs/tracing/client/Client.java
@@ -24,13 +24,16 @@ import java.util.Arrays;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-import com.uber.jaeger.Configuration;
-import com.uber.jaeger.samplers.ConstSampler;
-
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.tracing.opentracing.jaxrs.OpenTracingClientProvider;
 
 import demo.jaxrs.tracing.Slf4jLogSender;
+import io.jaegertracing.Configuration;
+import io.jaegertracing.Configuration.ReporterConfiguration;
+import io.jaegertracing.Configuration.SamplerConfiguration;
+import io.jaegertracing.Configuration.SenderConfiguration;
+import io.jaegertracing.internal.samplers.ConstSampler;
+import io.jaegertracing.spi.Sender;
 import io.opentracing.Tracer;
 
 public final class Client {
@@ -38,10 +41,17 @@ public final class Client {
     }
 
     public static void main(final String[] args) throws Exception {
-        final Tracer tracer = new Configuration("tracer-client", 
-                new Configuration.SamplerConfiguration(ConstSampler.TYPE, 1),
-                new Configuration.ReporterConfiguration(new Slf4jLogSender())
-            ).getTracer();
+        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
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_opentracing/src/main/java/demo/jaxrs/tracing/server/Server.java b/distribution/src/main/release/samples/jax_rs/tracing_opentracing/src/main/java/demo/jaxrs/tracing/server/Server.java
index 402637e..bd805aa 100644
--- a/distribution/src/main/release/samples/jax_rs/tracing_opentracing/src/main/java/demo/jaxrs/tracing/server/Server.java
+++ b/distribution/src/main/release/samples/jax_rs/tracing_opentracing/src/main/java/demo/jaxrs/tracing/server/Server.java
@@ -19,13 +19,18 @@
 
 package demo.jaxrs.tracing.server;
 
-import com.uber.jaeger.Configuration;
-import com.uber.jaeger.samplers.ConstSampler;
+import io.jaegertracing.Configuration;
+import io.jaegertracing.Configuration.ReporterConfiguration;
+import io.jaegertracing.Configuration.SamplerConfiguration;
+import io.jaegertracing.Configuration.SenderConfiguration;
+import io.jaegertracing.internal.samplers.ConstSampler;
+import io.jaegertracing.spi.Sender;
 
 import org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet;
 import org.eclipse.jetty.servlet.ServletContextHandler;
 import org.eclipse.jetty.servlet.ServletHolder;
 
+import demo.jaxrs.tracing.Slf4jLogSender;
 import io.opentracing.Tracer;
 import io.opentracing.util.GlobalTracer;
 
@@ -42,10 +47,17 @@ public class Server {
         servletHolder.setInitParameter("javax.ws.rs.Application",
             CatalogApplication.class.getName());
 
-        final Tracer tracer = new Configuration("tracer-server", 
-                new Configuration.SamplerConfiguration(ConstSampler.TYPE, 1),
-                new Configuration.ReporterConfiguration()
-            ).getTracer();
+        final Tracer tracer = new Configuration("tracer-server")
+            .withSampler(new SamplerConfiguration().withType(ConstSampler.TYPE).withParam(1))
+            .withReporter(new ReporterConfiguration().withSender(
+                new SenderConfiguration() {
+                    @Override
+                    public Sender getSender() {
+                        return new Slf4jLogSender();
+                    }
+                }
+            ))
+            .getTracer();
         GlobalTracer.register(tracer);
         
         server.setHandler(context);
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/pom.xml b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/pom.xml
index 103727a..4a65023 100644
--- a/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/pom.xml
+++ b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/pom.xml
@@ -31,7 +31,7 @@
     
     <properties>
         <cxf.version>${project.version}</cxf.version>
-        <cxf.camel.version>2.19.2</cxf.camel.version>
+        <cxf.camel.version>2.22.0</cxf.camel.version>
     </properties>
     
     <profiles>
@@ -176,10 +176,14 @@
             <artifactId>jetty-webapp</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.uber.jaeger</groupId>
+            <groupId>io.jaegertracing</groupId>
             <artifactId>jaeger-core</artifactId>
         </dependency>
-
+        <dependency>
+            <groupId>io.jaegertracing</groupId>
+            <artifactId>jaeger-thrift</artifactId>
+        </dependency>
+        
         <!-- spring-boot -->
         <dependency>
             <groupId>org.springframework.boot</groupId>
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/src/main/java/demo/jaxrs/tracing/client/Client.java b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/src/main/java/demo/jaxrs/tracing/client/Client.java
index b74582e..2f1396c 100644
--- a/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/src/main/java/demo/jaxrs/tracing/client/Client.java
+++ b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/src/main/java/demo/jaxrs/tracing/client/Client.java
@@ -23,13 +23,12 @@ import javax.ws.rs.client.ClientBuilder;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-import com.uber.jaeger.Tracer;
-import com.uber.jaeger.metrics.Metrics;
-import com.uber.jaeger.metrics.NullStatsReporter;
-import com.uber.jaeger.metrics.StatsFactoryImpl;
-import com.uber.jaeger.reporters.RemoteReporter;
-import com.uber.jaeger.samplers.ConstSampler;
-import com.uber.jaeger.senders.HttpSender;
+import io.jaegertracing.Configuration;
+import io.jaegertracing.Configuration.ReporterConfiguration;
+import io.jaegertracing.Configuration.SamplerConfiguration;
+import io.jaegertracing.Configuration.SenderConfiguration;
+import io.jaegertracing.internal.samplers.ConstSampler;
+import io.opentracing.Tracer;
 
 import org.apache.cxf.tracing.opentracing.jaxrs.OpenTracingClientProvider;
 import org.slf4j.Logger;
@@ -42,15 +41,15 @@ public final class Client {
     }
 
     public static void main(final String[] args) throws Exception {
-        final Metrics metrics = new Metrics(new StatsFactoryImpl(new NullStatsReporter()));
+        final Tracer tracer = new Configuration("cxf-client")
+            .withSampler(new SamplerConfiguration().withType(ConstSampler.TYPE).withParam(1))
+            .withReporter(new ReporterConfiguration().withSender(
+                new SenderConfiguration()
+                    .withEndpoint("http://localhost:14268/api/traces")
+            ))
+            .getTracer();
         
-        final Tracer.Builder builder = new Tracer.Builder(
-                "cxf-client", 
-                new RemoteReporter(new HttpSender("http://localhost:14268/api/traces"), 1000, 100, metrics),
-                new ConstSampler(true)
-            );
-        
-        final OpenTracingClientProvider provider = new OpenTracingClientProvider(builder.build());
+        final OpenTracingClientProvider provider = new OpenTracingClientProvider(tracer);
         final javax.ws.rs.client.Client client = ClientBuilder.newClient().register(provider);
         
         final Response response = client
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/src/main/java/demo/jaxrs/tracing/server/camel/Server.java b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/src/main/java/demo/jaxrs/tracing/server/camel/Server.java
index 196a506..5b8d2d5 100644
--- a/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/src/main/java/demo/jaxrs/tracing/server/camel/Server.java
+++ b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/src/main/java/demo/jaxrs/tracing/server/camel/Server.java
@@ -19,21 +19,21 @@
 
 package demo.jaxrs.tracing.server.camel;
 
-import com.uber.jaeger.Tracer;
-import com.uber.jaeger.metrics.Metrics;
-import com.uber.jaeger.metrics.NullStatsReporter;
-import com.uber.jaeger.metrics.StatsFactoryImpl;
-import com.uber.jaeger.propagation.TextMapCodec;
-import com.uber.jaeger.reporters.RemoteReporter;
-import com.uber.jaeger.samplers.ConstSampler;
-import com.uber.jaeger.senders.HttpSender;
-
 import org.apache.camel.opentracing.starter.CamelOpenTracing;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.WebApplicationType;
 import org.springframework.context.annotation.Bean;
 
+import io.jaegertracing.Configuration;
+import io.jaegertracing.Configuration.CodecConfiguration;
+import io.jaegertracing.Configuration.ReporterConfiguration;
+import io.jaegertracing.Configuration.SamplerConfiguration;
+import io.jaegertracing.Configuration.SenderConfiguration;
+import io.jaegertracing.internal.propagation.TextMapCodec;
+import io.jaegertracing.internal.samplers.ConstSampler;
+import io.opentracing.Tracer;
 import io.opentracing.propagation.Format.Builtin;
 
 @EnableAutoConfiguration
@@ -42,24 +42,27 @@ import io.opentracing.propagation.Format.Builtin;
 public class Server {
     public static void main(String[] args) {
         new SpringApplicationBuilder(Server.class)
-            .web(false)
+            .web(WebApplicationType.NONE)
             .build()
             .run(args);
     }
     
     @Bean
     Tracer tracer() {
-        final Metrics metrics = new Metrics(new StatsFactoryImpl(new NullStatsReporter()));
-        
-        final Tracer.Builder builder = 
-            new Tracer.Builder(
-                "camel-server", 
-                new RemoteReporter(new HttpSender("http://localhost:14268/api/traces"), 1000, 100, metrics),
-                new ConstSampler(true)
+        return new Configuration("camel-server")
+            .withSampler(
+                new SamplerConfiguration()
+                    .withType(ConstSampler.TYPE)
+                    .withParam(1))
+            .withReporter(new ReporterConfiguration().withSender(
+                new SenderConfiguration()
+                    .withEndpoint("http://localhost:14268/api/traces")
+            ))
+            .withCodec(
+                new CodecConfiguration()
+                    .withCodec(Builtin.TEXT_MAP, new TextMapCodec(true))
             )
-            .registerExtractor(Builtin.TEXT_MAP, new TextMapCodec(true));
-        
-        return builder.build();
+            .getTracer();
     }
 }
 
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/src/main/java/demo/jaxrs/tracing/server/cxf/Server.java b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/src/main/java/demo/jaxrs/tracing/server/cxf/Server.java
index 4c578d9..a662308 100644
--- a/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/src/main/java/demo/jaxrs/tracing/server/cxf/Server.java
+++ b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/src/main/java/demo/jaxrs/tracing/server/cxf/Server.java
@@ -20,9 +20,6 @@
 package demo.jaxrs.tracing.server.cxf;
 
 import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
-import com.uber.jaeger.Configuration;
-import com.uber.jaeger.samplers.ConstSampler;
-import com.uber.jaeger.senders.HttpSender;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
@@ -34,6 +31,11 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.context.annotation.Bean;
 
+import io.jaegertracing.Configuration;
+import io.jaegertracing.Configuration.ReporterConfiguration;
+import io.jaegertracing.Configuration.SamplerConfiguration;
+import io.jaegertracing.Configuration.SenderConfiguration;
+import io.jaegertracing.internal.samplers.ConstSampler;
 import io.opentracing.Tracer;
 
 @EnableAutoConfiguration
@@ -58,10 +60,13 @@ public class Server {
     
     @Bean @Qualifier("cxf")
     Tracer cxfTracer() {
-        return new Configuration("cxf-service", 
-                new Configuration.SamplerConfiguration(ConstSampler.TYPE, 1),
-                new Configuration.ReporterConfiguration(new HttpSender("http://localhost:14268/api/traces"))
-            ).getTracer();
+        return new Configuration("cxf-service")
+                .withSampler(new SamplerConfiguration().withType(ConstSampler.TYPE).withParam(1))
+                .withReporter(new ReporterConfiguration().withSender(
+                    new SenderConfiguration()
+                        .withEndpoint("http://localhost:14268/api/traces")
+                ))
+                .getTracer();
     }
 }
 
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/src/main/resources/META-INF/services/io.jaegertracing.spi.SenderFactory b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/src/main/resources/META-INF/services/io.jaegertracing.spi.SenderFactory
new file mode 100644
index 0000000..d726e4d
--- /dev/null
+++ b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_camel/src/main/resources/META-INF/services/io.jaegertracing.spi.SenderFactory
@@ -0,0 +1 @@
+io.jaegertracing.thrift.internal.senders.ThriftSenderFactory
\ No newline at end of file
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_opentracing_osgi/README.txt b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_osgi/README.txt
index 41a3cad..78d87ca 100644
--- a/distribution/src/main/release/samples/jax_rs/tracing_opentracing_osgi/README.txt
+++ b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_osgi/README.txt
@@ -57,10 +57,10 @@ Install the distributed tracer compatible with OpenTracing API, as in this examp
 we are using Uber Jaeger:
 
   install -s wrap:mvn:com.squareup.okio/okio/1.13.0
-  install -s wrap:mvn:com.squareup.okhttp3/okhttp/3.8.1
-  install -s wrap:mvn:org.apache.thrift/libthrift/0.9.2
-  install -s wrap:mvn:com.uber.jaeger/jaeger-thrift/0.20.6
-  install -s wrap:mvn:com.uber.jaeger/jaeger-core/0.20.6  
+  install -s wrap:mvn:com.squareup.okhttp3/okhttp/3.9.0
+  install -s wrap:mvn:org.apache.thrift/libthrift/0.11.0
+  install -s wrap:mvn:io.jaegertracing/jaeger-thrift/0.30.3
+  install -s wrap:mvn:io.jaegertracing/jaeger-core/0.30.3  
 
 Install this demo bundle (using the appropriate bundle version number)
   
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_opentracing_osgi/pom.xml b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_osgi/pom.xml
index 30d7121..d0b6b82 100644
--- a/distribution/src/main/release/samples/jax_rs/tracing_opentracing_osgi/pom.xml
+++ b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_osgi/pom.xml
@@ -81,17 +81,17 @@
             <artifactId>jetty-webapp</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.uber.jaeger</groupId>
+            <groupId>io.jaegertracing</groupId>
             <artifactId>jaeger-core</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.uber.jaeger</groupId>
+            <groupId>io.jaegertracing</groupId>
             <artifactId>jaeger-thrift</artifactId>
         </dependency>
         <dependency>
             <groupId>com.squareup.okhttp3</groupId>
             <artifactId>okhttp</artifactId>
-            <version>3.8.1</version>
+            <version>3.9.0</version>
         </dependency>
         <dependency>
             <groupId>com.squareup.okio</groupId>
@@ -118,7 +118,7 @@
                             org.osgi.service.blueprint,
                             javax.annotation;version="[1.2,2)",
                             org.apache.johnzon.core,
-                            !com.uber.jaeger.Tracer,
+                            !io.jaegertracing.Configuration,
                             *
                         </Import-Package>
                         <Export-Package>
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_opentracing_osgi/src/main/resources/META-INF/services/io.jaegertracing.spi.SenderFactory b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_osgi/src/main/resources/META-INF/services/io.jaegertracing.spi.SenderFactory
new file mode 100644
index 0000000..d726e4d
--- /dev/null
+++ b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_osgi/src/main/resources/META-INF/services/io.jaegertracing.spi.SenderFactory
@@ -0,0 +1 @@
+io.jaegertracing.thrift.internal.senders.ThriftSenderFactory
\ No newline at end of file
diff --git a/distribution/src/main/release/samples/jax_rs/tracing_opentracing_osgi/src/main/resources/OSGI-INF/blueprint/context.xml b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_osgi/src/main/resources/OSGI-INF/blueprint/context.xml
index 371350f..aef911f 100644
--- a/distribution/src/main/release/samples/jax_rs/tracing_opentracing_osgi/src/main/resources/OSGI-INF/blueprint/context.xml
+++ b/distribution/src/main/release/samples/jax_rs/tracing_opentracing_osgi/src/main/resources/OSGI-INF/blueprint/context.xml
@@ -32,41 +32,59 @@
 
     <bean id="tracingFeature" class="org.apache.cxf.tracing.opentracing.jaxrs.OpenTracingFeature">
         <argument index="0">
-            <bean factory-ref="builder" factory-method="build" />
+            <bean factory-ref="withReporter" factory-method="getTracer" />
         </argument>
     </bean>
+
+    <bean id="samplerBuilder" class="io.jaegertracing.Configuration.SamplerConfiguration" />
+    
+    <bean id="withType" factory-ref="samplerBuilder" factory-method="withType">
+        <argument index="0" value="const"/>
+    </bean>
     
-    <bean id="metrics" class="com.uber.jaeger.metrics.Metrics">
+    <bean id="sampler" factory-ref="withType" factory-method="withParam">
         <argument index="0">
-            <bean class="com.uber.jaeger.metrics.StatsFactoryImpl">
-                <argument index="0">
-                    <bean class="com.uber.jaeger.metrics.NullStatsReporter" />
-                </argument>
+            <bean class="java.lang.Integer">
+                <argument value="1" />
             </bean>
         </argument>
     </bean>
     
-    <bean id="builder" class="com.uber.jaeger.Tracer.Builder">
+    <bean id="senderBuilder" class="io.jaegertracing.Configuration.SenderConfiguration" />
+    
+    <bean id="sender" factory-ref="senderBuilder" factory-method="withEndpoint">
+    	<argument index="0" value="http://localhost:14268/api/traces"/>
+    </bean>
+    
+    <bean id="reporterBuilder" class="io.jaegertracing.Configuration.ReporterConfiguration" />
+    
+    <bean id="reporter" factory-ref="reporterBuilder" factory-method="withSender">
+    	<argument index="0" ref="sender"/>
+    </bean>
+    
+    <bean id="builder" class="io.jaegertracing.Configuration">
         <argument index="0" value="cxf-server" />
-        <argument index="1">
-            <bean class="com.uber.jaeger.reporters.RemoteReporter">
-                <argument index="0" ref="sender" />
-                <argument index="1" value="1000"/>
-                <argument index="2" value="100"/>
-                <argument index="3" ref="metrics"/>
-            </bean>
-        </argument>
-        <argument index="2">
-            <bean class="com.uber.jaeger.samplers.ConstSampler">
-                <argument index="0" value="true" />
-            </bean>
-        </argument>
+    </bean>
+
+	<bean id="withSampler" factory-ref="builder" factory-method="withSampler">
+        <argument index="0" ref="sampler"/>
     </bean>
     
-    <bean id="sender" class="com.uber.jaeger.senders.HttpSender">
-        <argument index="0" value="http://localhost:14268/api/traces" />
+    <bean id="withReporter" factory-ref="withSampler" factory-method="withReporter">
+        <argument index="0" ref="reporter"/>
     </bean>
     
+<!--         <property name="withReporter" ref="reporter" /> -->
+<!--         <argument index="2"> -->
+<!--             <bean class="com.uber.jaeger.samplers.ConstSampler"> -->
+<!--                 <argument index="0" value="true" /> -->
+<!--             </bean> -->
+<!--         </argument> -->
+    
+<!--     <bean id="sender" class="com.uber.jaeger.senders.HttpSender"> -->
+<!--         <argument index="0" value="http://localhost:14268/api/traces" /> -->
+<!--     </bean> -->
+    
     <!-- Application resources -->
     <bean id="catalogResource" class="demo.jaxrs.tracing.server.Catalog" />
 
diff --git a/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/AbstractOpenTracingClientProvider.java b/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/AbstractOpenTracingClientProvider.java
index 5dc94f8..ea58a02 100644
--- a/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/AbstractOpenTracingClientProvider.java
+++ b/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/AbstractOpenTracingClientProvider.java
@@ -28,8 +28,8 @@ import org.apache.cxf.jaxrs.utils.JAXRSUtils;
 import org.apache.cxf.tracing.AbstractTracingProvider;
 import org.apache.cxf.tracing.opentracing.internal.TextMapInjectAdapter;
 
-import io.opentracing.ActiveSpan;
-import io.opentracing.ActiveSpan.Continuation;
+import io.opentracing.Scope;
+import io.opentracing.Span;
 import io.opentracing.Tracer;
 import io.opentracing.propagation.Format.Builtin;
 import io.opentracing.tag.Tags;
@@ -47,30 +47,30 @@ public abstract class AbstractOpenTracingClientProvider extends AbstractTracingP
     protected TraceScopeHolder<TraceScope> startTraceSpan(final Map<String, List<String>> requestHeaders,
             URI uri, String method) {
 
-        final ActiveSpan parent = tracer.activeSpan();
-        ActiveSpan span = null; 
+        final Span parent = tracer.activeSpan();
+        Scope scope = null; 
         if (parent == null) {
-            span = tracer.buildSpan(buildSpanDescription(uri.toString(), method)).startActive();
+            scope = tracer.buildSpan(buildSpanDescription(uri.toString(), method)).startActive(false);
         } else {
-            span = tracer.buildSpan(buildSpanDescription(uri.toString(), method)).asChildOf(parent).startActive();
+            scope = tracer.buildSpan(buildSpanDescription(uri.toString(), method)).asChildOf(parent).startActive(false);
         }
 
         // Set additional tags 
-        span.setTag(Tags.HTTP_METHOD.getKey(), method);
-        span.setTag(Tags.HTTP_URL.getKey(), uri.toString());
+        scope.span().setTag(Tags.HTTP_METHOD.getKey(), method);
+        scope.span().setTag(Tags.HTTP_URL.getKey(), uri.toString());
 
-        tracer.inject(span.context(), Builtin.HTTP_HEADERS, new TextMapInjectAdapter(requestHeaders));
+        tracer.inject(scope.span().context(), Builtin.HTTP_HEADERS, new TextMapInjectAdapter(requestHeaders));
         
         // In case of asynchronous client invocation, the span should be detached as JAX-RS
         // client request / response filters are going to be executed in different threads.
-        Continuation continuation = null;
+        Span span = null;
         if (isAsyncInvocation()) {
-            continuation = span.capture();
-            span.deactivate();
+            span = scope.span();
+            scope.close();
         }
 
-        return new TraceScopeHolder<TraceScope>(new TraceScope(span, continuation), 
-            continuation != null /* detached */);
+        return new TraceScopeHolder<TraceScope>(new TraceScope(span, scope), 
+                span != null /* detached */);
     }
 
     private boolean isAsyncInvocation() {
@@ -82,18 +82,21 @@ public abstract class AbstractOpenTracingClientProvider extends AbstractTracingP
             return;
         }
 
-        final TraceScope scope = holder.getScope();
-        if (scope != null) {
-            ActiveSpan span = scope.getSpan();
+        final TraceScope traceScope = holder.getScope();
+        if (traceScope != null) {
+            Span span = traceScope.getSpan();
+            Scope scope = traceScope.getScope();
             
             // If the client invocation was asynchronous , the trace span has been created
             // in another thread and should be re-attached to the current one.
             if (holder.isDetached()) {
-                span = scope.getContinuation().activate();
+                scope = tracer.scopeManager().activate(span, false);
             }
 
-            span.setTag(Tags.HTTP_STATUS.getKey(), responseStatus);
-            span.close();
+            scope.span().setTag(Tags.HTTP_STATUS.getKey(), responseStatus);
+            scope.span().finish();
+            
+            scope.close();
         }
     }
 }
diff --git a/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/AbstractOpenTracingProvider.java b/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/AbstractOpenTracingProvider.java
index edaef29..0b1ea28 100644
--- a/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/AbstractOpenTracingProvider.java
+++ b/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/AbstractOpenTracingProvider.java
@@ -28,8 +28,8 @@ import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.phase.PhaseInterceptorChain;
 import org.apache.cxf.tracing.AbstractTracingProvider;
 
-import io.opentracing.ActiveSpan;
-import io.opentracing.ActiveSpan.Continuation;
+import io.opentracing.Scope;
+import io.opentracing.Span;
 import io.opentracing.SpanContext;
 import io.opentracing.Tracer;
 import io.opentracing.propagation.Format.Builtin;
@@ -57,29 +57,28 @@ public abstract class AbstractOpenTracingProvider extends AbstractTracingProvide
                     .collect(Collectors.toMap(Map.Entry::getKey, this::getFirstValueOrEmpty))
             ));
         
-        ActiveSpan scope = null;
+        Scope scope = null;
         if (parent == null) {
-            scope = tracer.buildSpan(buildSpanDescription(uri.getPath(), method)).startActive();
+            scope = tracer.buildSpan(buildSpanDescription(uri.getPath(), method)).startActive(false);
         } else {
-            scope = tracer.buildSpan(buildSpanDescription(uri.getPath(), method)).asChildOf(parent).startActive();
+            scope = tracer.buildSpan(buildSpanDescription(uri.getPath(), method)).asChildOf(parent).startActive(false);
         }
         
         // Set additional tags
-        scope.setTag(Tags.HTTP_METHOD.getKey(), method);
-        scope.setTag(Tags.HTTP_URL.getKey(), uri.toString());
+        scope.span().setTag(Tags.HTTP_METHOD.getKey(), method);
+        scope.span().setTag(Tags.HTTP_URL.getKey(), uri.toString());
         
         // If the service resource is using asynchronous processing mode, the trace
         // scope will be closed in another thread and as such should be detached.
-        Continuation continuation = null;
+        Span span = null;
         if (isAsyncResponse()) {
            // Do not modify the current context span
-            continuation = scope.capture();
-            propagateContinuationSpan(continuation);
-            scope.deactivate();
+            span = scope.span();
+            propagateContinuationSpan(span);
+            scope.close();
         } 
 
-        return new TraceScopeHolder<TraceScope>(new TraceScope(scope, continuation), 
-            continuation != null);
+        return new TraceScopeHolder<TraceScope>(new TraceScope(span, scope), span != null);
     }
 
     protected void stopTraceSpan(final Map<String, List<String>> requestHeaders,
@@ -91,19 +90,22 @@ public abstract class AbstractOpenTracingProvider extends AbstractTracingProvide
             return;
         }
 
-        final TraceScope scope = holder.getScope();
-        if (scope != null) {
-            ActiveSpan span = scope.getSpan();
+        final TraceScope traceScope = holder.getScope();
+        if (traceScope != null) {
+            Span span = traceScope.getSpan();
+            Scope scope = traceScope.getScope();
 
             // If the service resource is using asynchronous processing mode, the trace
             // scope has been created in another thread and should be re-attached to the current
             // one.
             if (holder.isDetached()) {
-                span = scope.getContinuation().activate();
+                scope = tracer.scopeManager().activate(span, false);
             }
 
-            span.setTag(Tags.HTTP_STATUS.getKey(), responseStatus);
-            span.close();
+            scope.span().setTag(Tags.HTTP_STATUS.getKey(), responseStatus);
+            scope.span().finish();
+            
+            scope.close();
         }
     }
 
@@ -111,8 +113,8 @@ public abstract class AbstractOpenTracingProvider extends AbstractTracingProvide
         return !PhaseInterceptorChain.getCurrentMessage().getExchange().isSynchronous();
     }
 
-    private void propagateContinuationSpan(final Continuation continuationScope) {
-        PhaseInterceptorChain.getCurrentMessage().put(Continuation.class, continuationScope);
+    private void propagateContinuationSpan(final Span continuation) {
+        PhaseInterceptorChain.getCurrentMessage().put(Span.class, continuation);
     }
 
     private String getFirstValueOrEmpty(Map.Entry<String, List<String>> entry) {
diff --git a/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/OpenTracingContext.java b/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/OpenTracingContext.java
index 772d685..7095042 100644
--- a/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/OpenTracingContext.java
+++ b/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/OpenTracingContext.java
@@ -23,42 +23,42 @@ import java.util.concurrent.Callable;
 import org.apache.cxf.tracing.Traceable;
 import org.apache.cxf.tracing.TracerContext;
 
-import io.opentracing.ActiveSpan;
-import io.opentracing.ActiveSpan.Continuation;
+import io.opentracing.Scope;
+import io.opentracing.Span;
 import io.opentracing.Tracer;
 
 public class OpenTracingContext implements TracerContext {
     private final Tracer tracer;
-    private final Continuation continuation;
+    private final Span continuation;
 
     public OpenTracingContext(final Tracer tracer) {
         this(tracer, null);
     }
 
-    public OpenTracingContext(final Tracer tracer, final Continuation continuation) {
+    public OpenTracingContext(final Tracer tracer, final Span continuation) {
         this.tracer = tracer;
         this.continuation = continuation;
     }
 
     @Override
     @SuppressWarnings("unchecked")
-    public ActiveSpan startSpan(final String description) {
+    public Scope startSpan(final String description) {
         return newOrChildSpan(description, null);
     }
 
     @Override
     public <T> T continueSpan(final Traceable<T> traceable) throws Exception {
-        ActiveSpan scope = null;
+        Scope scope = null;
         
         if (tracer.activeSpan() == null && continuation != null) {
-            scope = continuation.activate();
+            scope = tracer.scopeManager().activate(continuation, false);
         }
 
         try {
             return traceable.call(new OpenTracingContext(tracer));
         } finally {
             if (continuation != null && scope != null) {
-                scope.deactivate();
+                scope.close();
             }
         }
     }
@@ -73,9 +73,9 @@ public class OpenTracingContext implements TracerContext {
         };
 
         // Carry over parent from the current thread
-        final ActiveSpan parent = tracer.activeSpan();
+        final Span parent = tracer.activeSpan();
         return () -> {
-            try (ActiveSpan span = newOrChildSpan(description, parent)) {
+            try (Scope scope = newOrChildSpan(description, parent)) {
                 return callable.call();
             }
         };
@@ -83,7 +83,7 @@ public class OpenTracingContext implements TracerContext {
 
     @Override
     public void annotate(String key, String value) {
-        final ActiveSpan current = tracer.activeSpan();
+        final Span current = tracer.activeSpan();
         if (current != null) {
             current.setTag(key, value);
         }
@@ -91,17 +91,17 @@ public class OpenTracingContext implements TracerContext {
 
     @Override
     public void timeline(String message) {
-        final ActiveSpan current = tracer.activeSpan();
+        final Span current = tracer.activeSpan();
         if (current != null) {
             current.log(message);
         }
     }
     
-    private ActiveSpan newOrChildSpan(final String description, final ActiveSpan parent) {
+    private Scope newOrChildSpan(final String description, final Span parent) {
         if (parent == null) {
-            return tracer.buildSpan(description).startActive();
+            return tracer.buildSpan(description).startActive(true);
         } else {
-            return tracer.buildSpan(description).asChildOf(parent).startActive();
+            return tracer.buildSpan(description).asChildOf(parent).startActive(true);
         }
     }
 }
diff --git a/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/TraceScope.java b/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/TraceScope.java
index 7a9762d..3fa9858 100644
--- a/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/TraceScope.java
+++ b/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/TraceScope.java
@@ -18,23 +18,23 @@
  */
 package org.apache.cxf.tracing.opentracing;
 
-import io.opentracing.ActiveSpan;
-import io.opentracing.ActiveSpan.Continuation;
+import io.opentracing.Scope;
+import io.opentracing.Span;
 
 public class TraceScope {
-    private final ActiveSpan span;
-    private final Continuation continuation;
+    private final Span span;
+    private final Scope scope;
     
-    TraceScope(final ActiveSpan span, final Continuation continuation) {
+    TraceScope(final Span span, final Scope scope) {
         this.span = span;
-        this.continuation = continuation;
+        this.scope = scope;
     }
     
-    public ActiveSpan getSpan() {
+    public Span getSpan() {
         return span;
     }
     
-    public Continuation getContinuation() {
-        return continuation;
+    public Scope getScope() {
+        return scope;
     }
 }
diff --git a/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/jaxrs/OpenTracingContextProvider.java b/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/jaxrs/OpenTracingContextProvider.java
index 22bfd9d..57ccfff 100644
--- a/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/jaxrs/OpenTracingContextProvider.java
+++ b/integration/tracing/tracing-opentracing/src/main/java/org/apache/cxf/tracing/opentracing/jaxrs/OpenTracingContextProvider.java
@@ -23,7 +23,7 @@ import org.apache.cxf.message.Message;
 import org.apache.cxf.tracing.TracerContext;
 import org.apache.cxf.tracing.opentracing.OpenTracingContext;
 
-import io.opentracing.ActiveSpan.Continuation;
+import io.opentracing.Span;
 import io.opentracing.Tracer;
 
 public class OpenTracingContextProvider implements ContextProvider< TracerContext > {
@@ -36,7 +36,7 @@ public class OpenTracingContextProvider implements ContextProvider< TracerContex
     @Override
     public TracerContext createContext(final Message message) {
         // Check if there is a server span passed along with the message
-        final Continuation continuation = message.get(Continuation.class);
+        final Span continuation = message.get(Span.class);
 
         // If server span is already present, let us check if it is detached
         // (asynchronous invocation)
diff --git a/parent/pom.xml b/parent/pom.xml
index cd3fe09..014823e 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -230,8 +230,8 @@
         <cxf.brave.version>5.1.5</cxf.brave.version>
         <cxf.brave.zipkin.version>2.10.4</cxf.brave.zipkin.version>
         <cxf.brave.reporter.version>2.7.7</cxf.brave.reporter.version>
-        <cxf.opentracing.version>0.30.0</cxf.opentracing.version>
-        <cxf.jaeger.version>0.20.6</cxf.jaeger.version>
+        <cxf.opentracing.version>0.31.0</cxf.opentracing.version>
+        <cxf.jaeger.version>0.30.3</cxf.jaeger.version>
         <cxf.findbugs.version>3.0.2</cxf.findbugs.version>
         <cxf.checkstyle.extension />
         <cxf.jaxb.context.class />
@@ -2573,12 +2573,12 @@
                 <version>${cxf.opentracing.version}</version>
             </dependency>
             <dependency>
-                <groupId>com.uber.jaeger</groupId>
+                <groupId>io.jaegertracing</groupId>
                 <artifactId>jaeger-core</artifactId>
                 <version>${cxf.jaeger.version}</version>
             </dependency>
             <dependency>
-                <groupId>com.uber.jaeger</groupId>
+                <groupId>io.jaegertracing</groupId>
                 <artifactId>jaeger-thrift</artifactId>
                 <version>${cxf.jaeger.version}</version>
             </dependency>
diff --git a/systests/tracing/pom.xml b/systests/tracing/pom.xml
index ba27016..e8b9c31 100644
--- a/systests/tracing/pom.xml
+++ b/systests/tracing/pom.xml
@@ -137,7 +137,7 @@
             </exclusions>
         </dependency>
         <dependency>
-            <groupId>com.uber.jaeger</groupId>
+            <groupId>io.jaegertracing</groupId>
             <artifactId>jaeger-core</artifactId>
             <scope>test</scope>
         </dependency>
diff --git a/systests/tracing/src/test/java/org/apache/cxf/systest/jaeger/TestSender.java b/systests/tracing/src/test/java/org/apache/cxf/systest/jaeger/TestSender.java
index 77b13c6..7daa339 100644
--- a/systests/tracing/src/test/java/org/apache/cxf/systest/jaeger/TestSender.java
+++ b/systests/tracing/src/test/java/org/apache/cxf/systest/jaeger/TestSender.java
@@ -21,15 +21,15 @@ package org.apache.cxf.systest.jaeger;
 import java.util.ArrayList;
 import java.util.List;
 
-import com.uber.jaeger.Span;
-import com.uber.jaeger.exceptions.SenderException;
-import com.uber.jaeger.senders.Sender;
+import io.jaegertracing.internal.JaegerSpan;
+import io.jaegertracing.internal.exceptions.SenderException;
+import io.jaegertracing.spi.Sender;
 
 public class TestSender implements Sender {
-    private static List<Span> spans = new ArrayList<>();
+    private static List<JaegerSpan> spans = new ArrayList<>();
     
     @Override
-    public int append(Span span) throws SenderException {
+    public int append(JaegerSpan span) throws SenderException {
         spans.add(span);
         return 0;
     }
@@ -44,7 +44,7 @@ public class TestSender implements Sender {
         return 0;
     }
 
-    public static List<Span> getAllSpans() {
+    public static List<JaegerSpan> getAllSpans() {
         return spans;
     }
 
diff --git a/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/opentracing/HasSpan.java b/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/opentracing/HasSpan.java
index fecdd70..48174be 100644
--- a/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/opentracing/HasSpan.java
+++ b/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/opentracing/HasSpan.java
@@ -18,21 +18,21 @@
  */
 package org.apache.cxf.systest.jaxrs.tracing.opentracing;
 
-import com.uber.jaeger.LogData;
-import com.uber.jaeger.Span;
-
 import org.hamcrest.Description;
 import org.hamcrest.Matcher;
 import org.hamcrest.TypeSafeMatcher;
 import org.hamcrest.core.IsCollectionContaining;
 
-public class HasSpan extends IsCollectionContaining<Span> {
+import io.jaegertracing.internal.JaegerSpan;
+import io.jaegertracing.internal.LogData;
+
+public class HasSpan extends IsCollectionContaining<JaegerSpan> {
     public HasSpan(final String name) {
         this(name, null);
     }
 
     public HasSpan(final String name, final Matcher<Iterable<? super LogData>> matcher) {
-        super(new TypeSafeMatcher<Span>() {
+        super(new TypeSafeMatcher<JaegerSpan>() {
             @Override
             public void describeTo(Description description) {
                 description
@@ -47,7 +47,7 @@ public class HasSpan extends IsCollectionContaining<Span> {
             }
 
             @Override
-            protected boolean matchesSafely(Span item) {
+            protected boolean matchesSafely(JaegerSpan item) {
                 if (!name.equals(item.getOperationName())) {
                     return false;
                 }
diff --git a/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/opentracing/IsLogContaining.java b/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/opentracing/IsLogContaining.java
index b125eae..bfaf7ac 100644
--- a/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/opentracing/IsLogContaining.java
+++ b/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/opentracing/IsLogContaining.java
@@ -18,12 +18,12 @@
  */
 package org.apache.cxf.systest.jaxrs.tracing.opentracing;
 
-import com.uber.jaeger.LogData;
-
 import org.hamcrest.Description;
 import org.hamcrest.TypeSafeMatcher;
 import org.hamcrest.core.IsCollectionContaining;
 
+import io.jaegertracing.internal.LogData;
+
 public class IsLogContaining extends IsCollectionContaining<LogData> {
     public IsLogContaining(final String value) {
         super(new TypeSafeMatcher<LogData>() {
diff --git a/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/opentracing/OpenTracingTracingTest.java b/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/opentracing/OpenTracingTracingTest.java
index d2cab4b..8b3ff2d 100644
--- a/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/opentracing/OpenTracingTracingTest.java
+++ b/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/opentracing/OpenTracingTracingTest.java
@@ -36,9 +36,6 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 
 import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
-import com.uber.jaeger.Configuration;
-import com.uber.jaeger.SpanContext;
-import com.uber.jaeger.samplers.ConstSampler;
 
 import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
 import org.apache.cxf.jaxrs.client.WebClient;
@@ -52,7 +49,14 @@ import org.apache.cxf.tracing.opentracing.jaxrs.OpenTracingClientProvider;
 import org.apache.cxf.tracing.opentracing.jaxrs.OpenTracingFeature;
 import org.awaitility.Duration;
 
-import io.opentracing.ActiveSpan;
+import io.jaegertracing.Configuration;
+import io.jaegertracing.Configuration.ReporterConfiguration;
+import io.jaegertracing.Configuration.SamplerConfiguration;
+import io.jaegertracing.Configuration.SenderConfiguration;
+import io.jaegertracing.internal.JaegerSpanContext;
+import io.jaegertracing.internal.samplers.ConstSampler;
+import io.jaegertracing.spi.Sender;
+import io.opentracing.Scope;
 import io.opentracing.Tracer;
 import io.opentracing.propagation.Format.Builtin;
 import io.opentracing.propagation.TextMap;
@@ -80,14 +84,21 @@ public class OpenTracingTracingTest extends AbstractBusClientServerTestBase {
     @Ignore
     public static class Server extends AbstractBusTestServerBase {
         protected void run() {
-            final Tracer tracer = new Configuration("tracer-test-server", 
-                    new Configuration.SamplerConfiguration(ConstSampler.TYPE, 1),
-                    new Configuration.ReporterConfiguration(new TestSender())
-                ).getTracer();
-
+            final Tracer tracer = new Configuration("tracer-test-server")
+                .withSampler(new SamplerConfiguration().withType(ConstSampler.TYPE).withParam(1))
+                .withReporter(new ReporterConfiguration().withSender(
+                    new SenderConfiguration() {
+                        @Override
+                        public Sender getSender() {
+                            return new TestSender();
+                        }
+                    }
+                ))
+                .getTracer();
+            
             final JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
             sf.setResourceClasses(BookStore.class);
-            sf.setResourceProvider(BookStore.class, new SingletonResourceProvider(new BookStore<ActiveSpan>()));
+            sf.setResourceProvider(BookStore.class, new SingletonResourceProvider(new BookStore<Scope>()));
             sf.setAddress("http://localhost:" + PORT);
             sf.setProvider(new JacksonJsonProvider());
             sf.setProvider(new OpenTracingFeature(tracer));
@@ -107,10 +118,17 @@ public class OpenTracingTracingTest extends AbstractBusClientServerTestBase {
     public void setUp() {
         TestSender.clear();
 
-        tracer = new Configuration("tracer-test-client", 
-                new Configuration.SamplerConfiguration(ConstSampler.TYPE, 1),
-                new Configuration.ReporterConfiguration(new TestSender())
-            ).getTracer();
+        tracer = new Configuration("tracer-test-client")
+            .withSampler(new SamplerConfiguration().withType(ConstSampler.TYPE).withParam(1))
+            .withReporter(new ReporterConfiguration().withSender(
+                new SenderConfiguration() {
+                    @Override
+                    public Sender getSender() {
+                        return new TestSender();
+                    }
+                }
+            ))
+            .getTracer();
 
         openTracingClientProvider = new OpenTracingClientProvider(tracer);
         random = new Random();
@@ -128,7 +146,7 @@ public class OpenTracingTracingTest extends AbstractBusClientServerTestBase {
 
     @Test
     public void testThatNewInnerSpanIsCreated() {
-        final SpanContext spanId = fromRandom();
+        final JaegerSpanContext spanId = fromRandom();
 
         final Response r = withTrace(createWebClient("/bookstore/books"), spanId).get();
         assertEquals(Status.OK.getStatusCode(), r.getStatus());
@@ -140,7 +158,7 @@ public class OpenTracingTracingTest extends AbstractBusClientServerTestBase {
 
     @Test
     public void testThatCurrentSpanIsAnnotatedWithKeyValue() {
-        final SpanContext spanId = fromRandom();
+        final JaegerSpanContext spanId = fromRandom();
 
         final Response r = withTrace(createWebClient("/bookstore/book/1"), spanId).get();
         assertEquals(Status.OK.getStatusCode(), r.getStatus());
@@ -152,7 +170,7 @@ public class OpenTracingTracingTest extends AbstractBusClientServerTestBase {
 
     @Test
     public void testThatParallelSpanIsAnnotatedWithTimeline() {
-        final SpanContext spanId = fromRandom();
+        final JaegerSpanContext spanId = fromRandom();
 
         final Response r = withTrace(createWebClient("/bookstore/process"), spanId).put("");
         assertEquals(Status.OK.getStatusCode(), r.getStatus());
@@ -174,22 +192,22 @@ public class OpenTracingTracingTest extends AbstractBusClientServerTestBase {
 
     @Test
     public void testThatNewInnerSpanIsCreatedUsingAsyncInvocation() {
-        final SpanContext spanId = fromRandom();
+        final JaegerSpanContext spanId = fromRandom();
 
         final Response r = withTrace(createWebClient("/bookstore/books/async"), spanId).get();
         assertEquals(Status.OK.getStatusCode(), r.getStatus());
 
         assertThat(TestSender.getAllSpans().size(), equalTo(2));
-        assertThat(TestSender.getAllSpans().get(0).getOperationName(), equalTo("GET /bookstore/books/async"));
-        assertThat(TestSender.getAllSpans().get(1).getOperationName(), equalTo("Processing books"));
-        assertThat(TestSender.getAllSpans().get(0).getReferences(), not(empty()));
-        assertThat(TestSender.getAllSpans().get(0).getReferences().get(0).getSpanContext().getSpanId(), 
+        assertThat(TestSender.getAllSpans().get(0).getOperationName(), equalTo("Processing books"));
+        assertThat(TestSender.getAllSpans().get(1).getOperationName(), equalTo("GET /bookstore/books/async"));
+        assertThat(TestSender.getAllSpans().get(1).getReferences(), not(empty()));
+        assertThat(TestSender.getAllSpans().get(1).getReferences().get(0).getSpanContext().getSpanId(), 
             equalTo(spanId.getSpanId()));
     }
 
     @Test
     public void testThatOuterSpanIsCreatedUsingAsyncInvocation() {
-        final SpanContext spanId = fromRandom();
+        final JaegerSpanContext spanId = fromRandom();
 
         final Response r = withTrace(createWebClient("/bookstore/books/async/notrace"), spanId).get();
         assertEquals(Status.OK.getStatusCode(), r.getStatus());
@@ -204,8 +222,8 @@ public class OpenTracingTracingTest extends AbstractBusClientServerTestBase {
         assertEquals(Status.OK.getStatusCode(), r.getStatus());
 
         assertThat(TestSender.getAllSpans().size(), equalTo(2));
-        assertThat(TestSender.getAllSpans().get(0).getOperationName(), equalTo("GET /bookstore/books/async"));
-        assertThat(TestSender.getAllSpans().get(1).getOperationName(), equalTo("Processing books"));
+        assertThat(TestSender.getAllSpans().get(0).getOperationName(), equalTo("Processing books"));
+        assertThat(TestSender.getAllSpans().get(1).getOperationName(), equalTo("GET /bookstore/books/async"));
     }
 
     @Test
@@ -287,7 +305,7 @@ public class OpenTracingTracingTest extends AbstractBusClientServerTestBase {
     public void testThatProvidedSpanIsNotClosedWhenActive() throws MalformedURLException {
         final WebClient client = createWebClient("/bookstore/books", openTracingClientProvider);
 
-        try (ActiveSpan span = tracer.buildSpan("test span").startActive()) {
+        try (Scope span = tracer.buildSpan("test span").startActive(true)) {
             final Response r = client.get();
             assertEquals(Status.OK.getStatusCode(), r.getStatus());
 
@@ -312,12 +330,12 @@ public class OpenTracingTracingTest extends AbstractBusClientServerTestBase {
     public void testThatProvidedSpanIsNotDetachedWhenActiveUsingAsyncClient() throws Exception {
         final WebClient client = createWebClient("/bookstore/books", openTracingClientProvider);
 
-        try (ActiveSpan span = tracer.buildSpan("test span").startActive()) {
+        try (Scope scope = tracer.buildSpan("test span").startActive(true)) {
             final Future<Response> f = client.async().get();
 
             final Response r = f.get(1, TimeUnit.HOURS);
             assertEquals(Status.OK.getStatusCode(), r.getStatus());
-            assertThat(tracer.activeSpan().context(), equalTo(span.context()));
+            assertThat(tracer.activeSpan().context(), equalTo(scope.span().context()));
 
             assertThat(TestSender.getAllSpans().size(), equalTo(3));
             assertThat(TestSender.getAllSpans().get(0).getOperationName(), equalTo("Get Books"));
@@ -338,7 +356,7 @@ public class OpenTracingTracingTest extends AbstractBusClientServerTestBase {
 
     @Test
     public void testThatInnerSpanIsCreatedUsingPseudoAsyncInvocation() {
-        final SpanContext spanId = fromRandom();
+        final JaegerSpanContext spanId = fromRandom();
 
         final Response r = withTrace(createWebClient("/bookstore/books/pseudo-async"), spanId).get();
         assertEquals(Status.OK.getStatusCode(), r.getStatus());
@@ -354,7 +372,7 @@ public class OpenTracingTracingTest extends AbstractBusClientServerTestBase {
             .accept(MediaType.APPLICATION_JSON);
     }
 
-    protected WebClient withTrace(final WebClient client, final SpanContext spanContext) {
+    protected WebClient withTrace(final WebClient client, final JaegerSpanContext spanContext) {
         tracer.inject(spanContext, Builtin.HTTP_HEADERS, new TextMap() {
             
             @Override
@@ -379,8 +397,8 @@ public class OpenTracingTracingTest extends AbstractBusClientServerTestBase {
         }
     }
 
-    private SpanContext fromRandom() {
-        return new SpanContext(random.nextLong(), /* traceId */ random.nextLong() /* spanId */, 
+    private JaegerSpanContext fromRandom() {
+        return new JaegerSpanContext(random.nextLong(), /* traceId */ random.nextLong() /* spanId */, 
             random.nextLong() /* parentId */, (byte)1 /* sampled */);
     }
 }
diff --git a/systests/tracing/src/test/java/org/apache/cxf/systest/jaxws/tracing/opentracing/BookStore.java b/systests/tracing/src/test/java/org/apache/cxf/systest/jaxws/tracing/opentracing/BookStore.java
index 3310dae..6cc3abf 100644
--- a/systests/tracing/src/test/java/org/apache/cxf/systest/jaxws/tracing/opentracing/BookStore.java
+++ b/systests/tracing/src/test/java/org/apache/cxf/systest/jaxws/tracing/opentracing/BookStore.java
@@ -28,7 +28,7 @@ import javax.jws.WebService;
 import org.apache.cxf.systest.Book;
 import org.apache.cxf.systest.jaxws.tracing.BookStoreService;
 
-import io.opentracing.ActiveSpan;
+import io.opentracing.Scope;
 import io.opentracing.Tracer;
 import io.opentracing.util.GlobalTracer;
 
@@ -42,7 +42,7 @@ public class BookStore implements BookStoreService {
 
     @WebMethod
     public Collection< Book > getBooks() {
-        try (ActiveSpan span = tracer.buildSpan("Get Books").startActive()) {
+        try (Scope span = tracer.buildSpan("Get Books").startActive(true)) {
             return Arrays.asList(
                     new Book("Apache CXF in Action", UUID.randomUUID().toString()),
                     new Book("Mastering Apache CXF", UUID.randomUUID().toString())
diff --git a/systests/tracing/src/test/java/org/apache/cxf/systest/jaxws/tracing/opentracing/OpenTracingTracingTest.java b/systests/tracing/src/test/java/org/apache/cxf/systest/jaxws/tracing/opentracing/OpenTracingTracingTest.java
index 1c6f20a..6abbec0 100644
--- a/systests/tracing/src/test/java/org/apache/cxf/systest/jaxws/tracing/opentracing/OpenTracingTracingTest.java
+++ b/systests/tracing/src/test/java/org/apache/cxf/systest/jaxws/tracing/opentracing/OpenTracingTracingTest.java
@@ -26,10 +26,6 @@ import java.util.Random;
 
 import javax.xml.ws.soap.SOAPFaultException;
 
-import com.uber.jaeger.Configuration;
-import com.uber.jaeger.SpanContext;
-import com.uber.jaeger.samplers.ConstSampler;
-
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.ext.logging.LoggingInInterceptor;
 import org.apache.cxf.ext.logging.LoggingOutInterceptor;
@@ -46,7 +42,14 @@ import org.apache.cxf.tracing.opentracing.OpenTracingFeature;
 import org.apache.cxf.tracing.opentracing.internal.TextMapInjectAdapter;
 import org.awaitility.Duration;
 
-import io.opentracing.ActiveSpan;
+import io.jaegertracing.Configuration;
+import io.jaegertracing.Configuration.ReporterConfiguration;
+import io.jaegertracing.Configuration.SamplerConfiguration;
+import io.jaegertracing.Configuration.SenderConfiguration;
+import io.jaegertracing.internal.JaegerSpanContext;
+import io.jaegertracing.internal.samplers.ConstSampler;
+import io.jaegertracing.spi.Sender;
+import io.opentracing.Scope;
 import io.opentracing.Tracer;
 import io.opentracing.propagation.Format.Builtin;
 import io.opentracing.util.GlobalTracer;
@@ -71,10 +74,17 @@ public class OpenTracingTracingTest extends AbstractBusClientServerTestBase {
     @Ignore
     public static class Server extends AbstractBusTestServerBase {
         protected void run() {
-            final Tracer tracer = new Configuration("book-store", 
-                    new Configuration.SamplerConfiguration(ConstSampler.TYPE, 1),
-                    new Configuration.ReporterConfiguration(new TestSender())
-                ).getTracer();
+            final Tracer tracer = new Configuration("book-store")
+                .withSampler(new SamplerConfiguration().withType(ConstSampler.TYPE).withParam(1))
+                .withReporter(new ReporterConfiguration().withSender(
+                    new SenderConfiguration() {
+                        @Override
+                        public Sender getSender() {
+                            return new TestSender();
+                        }
+                    }
+                ))
+                .getTracer();
             GlobalTracer.register(tracer);
             
             final JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
@@ -100,10 +110,17 @@ public class OpenTracingTracingTest extends AbstractBusClientServerTestBase {
     public void setUp() {
         random = new Random();
         
-        tracer = new Configuration("tracer", 
-                new Configuration.SamplerConfiguration(ConstSampler.TYPE, 1),
-                new Configuration.ReporterConfiguration(new TestSender())
-            ).getTracer();
+        tracer = new Configuration("tracer")
+            .withSampler(new SamplerConfiguration().withType(ConstSampler.TYPE).withParam(1))
+            .withReporter(new ReporterConfiguration().withSender(
+                new SenderConfiguration() {
+                    @Override
+                    public Sender getSender() {
+                        return new TestSender();
+                    }
+                }
+            ))
+            .getTracer();
 
         TestSender.clear();
     }
@@ -120,7 +137,7 @@ public class OpenTracingTracingTest extends AbstractBusClientServerTestBase {
 
     @Test
     public void testThatNewInnerSpanIsCreated() throws MalformedURLException {
-        final SpanContext spanId = fromRandom();
+        final JaegerSpanContext spanId = fromRandom();
 
         final Map<String, List<String>> headers = new HashMap<>();
         tracer.inject(spanId, Builtin.HTTP_HEADERS, new TextMapInjectAdapter(headers));
@@ -160,7 +177,7 @@ public class OpenTracingTracingTest extends AbstractBusClientServerTestBase {
             }
         });
 
-        try (ActiveSpan scope = tracer.buildSpan("test span").startActive()) {
+        try (Scope scope = tracer.buildSpan("test span").startActive(true)) {
             assertThat(service.getBooks().size(), equalTo(2));
             assertThat(tracer.activeSpan(), not(nullValue()));
 
@@ -253,8 +270,8 @@ public class OpenTracingTracingTest extends AbstractBusClientServerTestBase {
         return service;
     }
 
-    private SpanContext fromRandom() {
-        return new SpanContext(random.nextLong(), /* traceId */ random.nextLong() /* spanId */, 
+    private JaegerSpanContext fromRandom() {
+        return new JaegerSpanContext(random.nextLong(), /* traceId */ random.nextLong() /* spanId */, 
             random.nextLong() /* parentId */, (byte)1 /* sampled */);
     }
 }


Mime
View raw message