Integrating Dropwizard to Zipkin tracer using Brave
This project uses Brave jersey filters to integrate into Zipkin.
This Dropwizard bundle that will add in the servlet filter for you. Jersey client filters have to be manually added to your client classes.
Add the following dependency into your pom.xml
<dependency>
<groupId>com.github.rojanu</groupId>
<artifactId>dropwizard-brave</artifactId>
<version>0.1-SNAPSHOT</version>
</dependency>
Add BraveTraceConfiguration
into your application's configuration class.
public class ExampleConfiguration extends Configuration {
private BraveTraceConfiguration braveTraceConfiguration = new BraveTraceConfiguration();
public BraveTraceConfiguration getBraveTraceConfiguration() {
return braveTraceConfiguration;
}
public void setRequestTrackerConfiguration(BraveTraceConfiguration configuration) {
this.braveTraceConfiguration = configuration;
}
}
Add the BraveBundle
to your application
bootstrap.addBundle(new BraveBundle<ExampleConfiguration>() {
@Override
public BraveTraceConfiguration getBraveTraceConfiguration(ExampleConfiguration exampleConfiguration) {
return exampleConfiguration.getBraveTraceConfiguration();
}
});
and mvn clean install