Author: buildbot Date: Fri Jun 2 02:47:48 2017 New Revision: 1013324 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 Fri Jun 2 02:47:48 2017 @@ -118,11 +118,11 @@ Apache CXF -- Using OpenZipkin Brave <!-- Content --> <div class="wiki-content"> <div id="ConfluenceContent"><p><style type="text/css">/*<![CDATA[*/ -div.rbtoc1496364443554 {padding: 0px;} -div.rbtoc1496364443554 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1496364443554 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1496371635041 {padding: 0px;} +div.rbtoc1496371635041 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1496371635041 li {margin-left: 0px;padding-left: 0px;} -/*]]>*/</style></p><div class="toc-macro rbtoc1496364443554"> +/*]]>*/</style></p><div class="toc-macro rbtoc1496371635041"> <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-DistributedTracingwithOpenZipkinBraveandOSGi">Distributed Tracing with OpenZipkin Brave and OSGi</a></li><li><a shape="rect" href="#UsingOpenZipkinBrave-Migratingfrombrave-cxf3">Migrating from brave-cxf3</a></li></ul> @@ -275,15 +275,7 @@ public Collection<Book> 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 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"> +</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. 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 Collection<Book> getBooks(@Context final TracerContext tracer) throws Exception { @@ -313,15 +305,7 @@ public Collection<Book> 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). 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"> +</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"> <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 {