Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 InheritableServerClientAndLocalSpanState):

...

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();

The client-side code stays unchanged.

...