Coder Social home page Coder Social logo

wavefront-jaxrs-sdk-java's Introduction

wavefront-jaxrs-sdk-java build status Released Version

The Wavefront by VMware JAX-RS SDK for Java provides out-of-the-box trace data from JAX-RS based clients in your Java application. You can analyze the tracing data in Wavefront to better understand how your application is performing in production. If you have multiple services running, you can instrument your server-side service with our Wavefront Jersey SDK to form a complete trace.

Maven

If you are using Maven, add the following maven dependency to your pom.xml:

<dependency>
    <groupId>com.wavefront</groupId>
    <artifactId>wavefront-jaxrs-sdk-java</artifactId>
    <version>$releaseVersion</version>
</dependency>

Replace $releaseVersion with the latest version available on maven.

WavefrontJaxrsClientFilter

Follow the steps below to set up a WavefrontJaxrsClientFilter. For each client that uses a JAX-RS-compliant framework:

  1. Create an ApplicationTags instance, which specifies metadata about your application.
  2. Create a WavefrontSender for sending data to Wavefront.
  3. Create a WavefrontSpanReporter for reporting trace data to Wavefront.
  4. Create a WavefrontTracer as the tracer for generating traces and spans.
  5. Create a WavefrontJaxrsClientFilter.
  6. Register the WavefrontJaxrsClientFilter.

For the details of each step, see the sections below.

1. Set Up Application Tags

Application tags determine the metadata (point tags and span tags) that are included with every metric/histogram/span reported to Wavefront. These tags enable you to filter and query the reported data in Wavefront.

You encapsulate application tags in an ApplicationTags object. See Instantiating ApplicationTags for details.

2. Set Up a WavefrontSender

A WavefrontSender object implements the low-level interface for sending data to Wavefront. You can choose to send data to Wavefront using either the Wavefront proxy or direct ingestion.

  • If you have already set up a WavefrontSender for another SDK that will run in the same JVM, use that one. (For details about sharing a WavefrontSender instance, see Share a WavefrontSender.)

  • Otherwise, follow the steps in Set Up a WavefrontSender.

3. Set Up a WavefrontSpanReporter

A WavefrontSpanReporter reports trace data to Wavefront. To build a WavefrontSpanReporter, you specify:

  • The WavefrontSender you created above.
  • The source of the reported trace data, typically the name of the host that the code is running on.
sourceName = "mySource"; // Example - Replace value!
Reporter wfSpanReporter = new WavefrontSpanReporter.Builder().
    withSource(sourceName).build(wavefrontSender);

4. Set Up a WavefrontTracer

A WavefrontTracer creates trace data from your JAX-RS client, and sends the data to Wavefront through a WavefrontSpanReporter.

To build a WavefrontTracer, you specify the WavefrontSpanReporter and the ApplicationTags you created above.

WavefrontTracer wfTracer = new WavefrontTracer.Builder(wfSpanReporter,   
    applicationTags).build();

5. Set Up a WavefrontJaxrsClientFilter

To build the WavefrontJaxrsClientFilter, you specify:

  • The WavefrontSender, ApplicationTags and WavefrontTracer you created above.
  • The same source that you specified when creating the WavefrontSpanReporter.
sourceName = "mySource"; // Example - Replace value!
WavefrontJaxrsClientFilter filter = new WavefrontJaxrsClientFilter(wfSender,  
    applicationTags, sourceName, wfTracer);

6. Register the WavefrontJaxrsClientFilter

For any JAX-RS-compliant ClientBuilder, register your filter as follows:

clientBuilder.register(filter);

wavefront-jaxrs-sdk-java's People

Contributors

akodali18 avatar amitw-vmware avatar dependabot[bot] avatar hanwavefront avatar haosong avatar oppegard avatar shavidissa avatar srujann avatar susanjlindner avatar sushantdewan123 avatar vikramraman avatar wf-jenkins avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.