# OpenCensus JAX-RS
[![Build Status][travis-image]][travis-url]
[![Windows Build Status][appveyor-image]][appveyor-url]
[![Maven Central][maven-image]][maven-url]
The *OpenCensus JAX-RS for Java* is a container and client filter for trace instrumentation when using JAX-RS for REST implementation in Java.
## Quickstart
### Add the dependencies to your project
For Maven add to your `pom.xml`:
```xml
io.opencensusopencensus-api0.28.3io.opencensusopencensus-contrib-http-jaxrs0.28.3
```
For Gradle add to your dependencies:
```groovy
compile 'io.opencensus:opencensus-api:0.28.3'
compile 'io.opencensus:opencensus-contrib-http-jaxrs:0.28.3'
```
### Usage
#### Container Filter
The container filter should be added to the JAX-RS `Application` class and endpoints should be annotated
with `@Metrics` annotation.
```java
class MyApplication extends Application {
@Override
public Set> getClasses() {
Set> providers = new HashSet<>(super.getClasses());
providers.add(JaxrsContainerFilter.class);
return providers;
}
}
```
It is possible to customize the filter by using the custom constructor. The below will
use the `B3Format` for context propagation instead of the W3C text context format.
```java
class MyApplication extends Application {
@Override
public Set