Versions Compared

Key

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

...

It is also worth to mention the way Apache CXF attaches the description to spans. With regards to the client integration, the description becomes a full URL being invoked prefixed by HTTP method, for example: GET http://localhost:8282/books. On the server side integration, the description becomes a relative JAX-RS resource path prefixed by HTTP method, f.e.: GET books, POST book/123

Configuring Client

There are a couple of ways the JAX-RS client could be configured, depending on the client implementation. Apache CXF provides its own WebClient which could be configured just like that (in future versions, there would be a simpler ways to do that using client specific features):

Code Block
java
java
// Configure the spans transport sender
final Sender sender = ...; 

/**
 * For example:
 * final Sender sender = LibthriftSender.create("localhost");; 
 */
        
final Brave brave = new Brave.Builder("web-client")
    .reporter(AsyncReporter.builder(sender).build())
    .build();
        
Response response = WebClient
    .create("http://localhost:9000/catalog", Arrays.asList(new BraveClientProvider(brave)))
    .accept(MediaType.APPLICATION_JSON)
    .get();

The configuration based on using the standard JAX-RS Client is very similar:

Code Block
java
java
// Configure the spans transport sender
final Sender sender = ...; 

/**
 * For example:
 * final Sender sender = LibthriftSender.create("localhost");; 
 */
        
final Brave brave = new Brave.Builder("jaxrs-client")
    .reporter(AsyncReporter.builder(sender).build())
    .build();
                
final BraveClientProvider provider = new BraveClientProvider(brave);
final Client client = ClientBuilder.newClient().register(provider);

final Response response = client
    .target("http://localhost:9000/catalog")
    .request()
    .accept(MediaType.APPLICATION_JSON)
    .get();

 / TODO

Configuring Server

// TODO

...