You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2017/02/07 03:47:52 UTC

svn commit: r1006333 - in /websites/production/cxf/content: cache/docs.pageCache docs/using-openzipkin-brave.html

Author: buildbot
Date: Tue Feb  7 03:47:52 2017
New Revision: 1006333

Log:
Production update by buildbot for cxf

Modified:
    websites/production/cxf/content/cache/docs.pageCache
    websites/production/cxf/content/docs/using-openzipkin-brave.html

Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/cxf/content/docs/using-openzipkin-brave.html
==============================================================================
--- websites/production/cxf/content/docs/using-openzipkin-brave.html (original)
+++ websites/production/cxf/content/docs/using-openzipkin-brave.html Tue Feb  7 03:47:52 2017
@@ -117,11 +117,11 @@ Apache CXF -- Using OpenZipkin Brave
            <!-- Content -->
            <div class="wiki-content">
 <div id="ConfluenceContent"><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1486435616882 {padding: 0px;}
-div.rbtoc1486435616882 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1486435616882 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1486439239441 {padding: 0px;}
+div.rbtoc1486439239441 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1486439239441 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1486435616882">
+/*]]>*/</style></p><div class="toc-macro rbtoc1486439239441">
 <ul class="toc-indentation"><li><a shape="rect" href="#UsingOpenZipkinBrave-Overview">Overview</a></li><li><a shape="rect" href="#UsingOpenZipkinBrave-DistributedTracinginApacheCXFusingOpenZipkinBrave">Distributed Tracing in Apache CXF using OpenZipkin Brave</a></li><li><a shape="rect" href="#UsingOpenZipkinBrave-configuringclientConfiguringClient">Configuring Client</a></li><li><a shape="rect" href="#UsingOpenZipkinBrave-configuringserverConfiguringServer">Configuring Server</a></li><li><a shape="rect" href="#UsingOpenZipkinBrave-DistributedTracingInAction:UsageScenarios">Distributed Tracing In Action: Usage Scenarios</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#UsingOpenZipkinBrave-Example#1:ClientandServerwithdefaultdistributedtracingconfigured">Example #1: Client and Server with default distributed tracing configured</a></li><li><a shape="rect" href="#UsingOpenZipkinBrave-Example#2:ClientandServerwithnestedtrace">Example #2: Client and Server with nested trace</a></li><li><a shape="rect" href="#UsingOpenZipkinBrave-Example#3:ClientandServertracewithannotations">Example #3: Client and Server trace with annotations</a></li><li><a shape="rect" href="#UsingOpenZipkinBrave-Example#4:ClientandServerwithbinaryannotations(key/value)">Example #4: Client and Server with binary annotations (key/value)</a></li><li><a shape="rect" href="#UsingOpenZipkinBrave-Example#5:ClientandServerwithparalleltrace(involvingthreadpools)">Example #5: Client and Server with parallel trace (involving thread pools)</a></li><li><a shape="rect" href="#UsingOpenZipkinBrave-Example#6:ClientandServerwithasynchronousJAX-
 RSservice(server-side)">Example #6: Client and Server with asynchronous JAX-RS service (server-side)</a></li><li><a shape="rect" href="#UsingOpenZipkinBrave-Example#7:ClientandServerwithasynchronousinvocation(client-side)">Example #7: Client and Server with asynchronous invocation (client-side)</a></li></ul>
 </li><li><a shape="rect" href="#UsingOpenZipkinBrave-DistributedTracingwithOpenZipkinBraveandJAX-WSsupport">Distributed Tracing with OpenZipkin Brave and JAX-WS support</a></li><li><a shape="rect" href="#UsingOpenZipkinBrave-Migratingfrombrave-cxf3">Migrating from brave-cxf3</a></li></ul>
@@ -266,7 +266,7 @@ public Collection&lt;Book&gt; getBooks(@
     tracer.annotate("# of books", Integer.toString(books.size()));
     return books;
 }</pre>
-</div></div><p class="label label-default service-filter-label service-tag-filtered">The actual invocation of the request by the client (with service name <strong><span class="label label-default service-filter-label service-tag-filtered"><strong><span class="label label-default service-filter-label service-tag-filtered"><strong>tracer</strong></span></strong>-client</span></strong>) and consequent invocation of the service on the server side (service name<strong> tracer-<span class="label label-default service-filter-label">server</span></strong>) is going to generate the following sample server trace properties:</p><p class="label label-default service-filter-label service-tag-filtered"><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image" height="250" src="using-openzipkin-brave.data/image2017-2-6%2020:49:43.png"></span></p><h2 id="UsingOpenZipkinBrave-Example#5:ClientandServerwithparalleltrace(involvingthreadpools)"
 >Example #5: Client and Server with parallel trace (involving thread pools)</h2><p>In this example server-side implementation of the JAX-RS service is going to offload some work into thread pool and then return the response to the client, simulating parallel execution.For this example to work, the Brave on server side should be con figured a little bit differently:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p class="label label-default service-filter-label service-tag-filtered">The actual invocation of the request by the client (with service name <strong><span class="label label-default service-filter-label service-tag-filtered"><strong><span class="label label-default service-filter-label service-tag-filtered"><strong>tracer</strong></span></strong>-client</span></strong>) and consequent invocation of the service on the server side (service name<strong> tracer-<span class="label label-default service-filter-label">server</span></strong>) is going to generate the following sample server trace properties:</p><p class="label label-default service-filter-label service-tag-filtered"><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image" height="250" src="using-openzipkin-brave.data/image2017-2-6%2020:49:43.png"></span></p><h2 id="UsingOpenZipkinBrave-Example#5:ClientandServerwithparalleltrace(involvingthreadpools)"
 >Example #5: Client and Server with parallel trace (involving thread pools)</h2><p>In this example server-side implementation of the JAX-RS service is going to offload some work into thread pool and then return the response to the client, simulating parallel execution.For this example to work, the OpenZipkin Brave on server side should be configured a little bit differently (using <strong>InheritableServerClientAndLocalSpanState</strong>):</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">final Endpoint endpoint =  Endpoint.create("tracer-server",
     ByteBuffer.wrap(Inet4Address.getLocalHost().getAddress()).getInt());
         
@@ -304,7 +304,15 @@ public Collection&lt;Book&gt; getBooks(@
        
     return Arrays.asList(book1.get(), book2.get());
 }</pre>
-</div></div><p>The actual invocation of the request by the client (with service name <strong>tracer-<span class="label label-default service-filter-label service-tag-filtered">client</span></strong>) and consequent invocation of the service on the server side (process name<strong> tracer-<span class="label label-default service-filter-label">server</span></strong>) is going to generate the following sample traces:</p><p><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image" width="900" src="using-openzipkin-brave.data/image2017-2-6%2021:41:1.png"></span></p><h2 id="UsingOpenZipkinBrave-Example#6:ClientandServerwithasynchronousJAX-RSservice(server-side)">Example #6: Client and Server with asynchronous JAX-RS service (server-side)</h2><p>In this example server-side implementation of the JAX-RS service is going to be executed asynchronously. It poses a challenge from the tracing prospective as request and response are proce
 ssed in different threads (in general). At the moment, <a shape="rect" href="http://cxf.apache.org/">Apache CXF</a> does not support the transparent tracing spans management (except for default use case) but provides the simple ways to do that (by letting to transfer spans from thread to thread). The client-side code stays unchanged.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>The actual invocation of the request by the client (with service name <strong>tracer-<span class="label label-default service-filter-label service-tag-filtered">client</span></strong>) and consequent invocation of the service on the server side (process name<strong> tracer-<span class="label label-default service-filter-label">server</span></strong>) is going to generate the following sample traces:</p><p><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image" width="900" src="using-openzipkin-brave.data/image2017-2-6%2021:41:1.png"></span></p><h2 id="UsingOpenZipkinBrave-Example#6:ClientandServerwithasynchronousJAX-RSservice(server-side)">Example #6: Client and Server with asynchronous JAX-RS service (server-side)</h2><p>In this example server-side implementation of the JAX-RS service is going to be executed asynchronously. It poses a challenge from the tracing prospective as request and response are proce
 ssed in different threads (in general). At the moment, <a shape="rect" href="http://cxf.apache.org/">Apache CXF</a> does not support the transparent tracing spans management (except for default use case) but provides the simple ways to do that (by letting to transfer spans from thread to thread). As with the previous example, the OpenZipkin Brave on server side should be configured a little bit differently (using <strong>InheritableServerClientAndLocalSpanState</strong>):</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">final Endpoint endpoint =  Endpoint.create("tracer-server",
+    ByteBuffer.wrap(Inet4Address.getLocalHost().getAddress()).getInt());
+        
+final Brave brave = new Brave.Builder(new InheritableServerClientAndLocalSpanState(endpoint))
+    .reporter(AsyncReporter.builder(sender).build())
+    .traceSampler(Sampler.ALWAYS_SAMPLE)
+    .build();</pre>
+</div></div><p>The client-side code stays unchanged.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">@Produces( { MediaType.APPLICATION_JSON } )
 @GET
 public void getBooks(@Suspended final AsyncResponse response, @Context final TracerContext tracer) throws Exception {
@@ -329,7 +337,7 @@ public void getBooks(@Suspended final As
         }
     });
 }</pre>
-</div></div><p class="label label-default service-filter-label service-tag-filtered">The actual invocation of the request by the client (with service name <strong>tracer-<span class="label label-default service-filter-label service-tag-filtered">client</span></strong>) and consequent invocation of the service on the server side (service name<strong> tracer-<span class="label label-default service-filter-label">server</span></strong>) is going to generate the following sample traces:</p><h2 id="UsingOpenZipkinBrave-Example#7:ClientandServerwithasynchronousinvocation(client-side)">Example #7: Client and Server with asynchronous invocation (client-side)</h2><p>In this example server-side implementation of the JAX-RS service is going to be the default one:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p class="label label-default service-filter-label service-tag-filtered">The actual invocation of the request by the client (with service name <strong>tracer-<span class="label label-default service-filter-label service-tag-filtered">client</span></strong>) and consequent invocation of the service on the server side (service name<strong> tracer-<span class="label label-default service-filter-label">server</span></strong>) is going to generate the following sample traces:</p><p class="label label-default service-filter-label service-tag-filtered"><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image" width="900" src="using-openzipkin-brave.data/image2017-2-6%2021:46:48.png"></span></p><h2 id="UsingOpenZipkinBrave-Example#7:ClientandServerwithasynchronousinvocation(client-side)">Example #7: Client and Server with asynchronous invocation (client-side)</h2><p>In this example server-side implementation of the JAX-
 RS service is going to be the default one:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">@Produces( { MediaType.APPLICATION_JSON } )
 @GET
 public Collection&lt;Book&gt; getBooks() {