Skip to content

Brave v4.7

Compare
Choose a tag to compare
@codefromthecrypt codefromthecrypt released this 14 Sep 10:20
· 1009 commits to master since this release

Brave 4.7 includes enhancements from our community members and the ability to send data to Zipkin in v2 json format.

@hypnoce noticed the service graph wasn't accurate when tracing multiple database connections with our JDBC tracer. You can now control the remote service name by adding a DB property like below:

jdbc:mysql://127.0.0.1:3306/mydatabase?zipkinServiceName=myServiceName

@jorgheymans also helped in the same JDBC trace instrumentation by fixing an unrelated race condition.

@jcchavezs raised his first java language pull request, ensuring when the tracing component is in noop mode, no data collection happens.

Zipkin v2 format

(note this is updated for version 4.8)

Brave uses the zipkin-reporter project to send data to Zipkin collectors. Our version 2 json format is smaller and measurably more efficient.

Once you've upgraded your Zipkin servers, opt-into the version 2 format by using the dependency io.zipkin.reporter2:zipkin-reporter and your favorite sender ex io.zipkin.reporter2:zipkin-sender-okhttp3
Ex:

   /** Configuration for how to send spans to Zipkin */
   @Bean Sender sender() {
-    return OkHttpSender.create("http://your_host:9411/api/v1/spans");
+    return OkHttpSender.create("http://your_host:9411/api/v2/spans");
   }
 
   /** Configuration for how to buffer spans into messages for Zipkin */
-  @Bean Reporter<Span> reporter() {
-    return AsyncReporter.builder(sender()).build();
+  @Bean Reporter<Span> spanReporter() {
+    return AsyncReporter.create(sender()).build();
   }

Stick the v2 reporter here in Brave:

     return Tracing.newBuilder()
-        .reporter(reporter()).build();
+        .spanReporter(spanReporter()).build();

If you are using Spring XML, the related change looks like this:

-  <bean id="sender" class="zipkin.reporter.okhttp3.OkHttpSender" factory-method="create"
+  <bean id="sender" class="zipkin.reporter2.okhttp3.OkHttpSender" factory-method="create"
       destroy-method="close">
-    <constructor-arg type="String" value="http://localhost:9411/api/v1/spans"/>
+    <constructor-arg type="String" value="http://localhost:9411/api/v2/spans"/>
   </bean>
 
   <bean id="tracing" class="brave.spring.beans.TracingFactoryBean">
     <property name="reporter">
       <bean class="brave.spring.beans.AsyncReporterFactoryBean">
+        <property name="encoder" value="JSON_V2"/>

Thanks for all the efforts. Very likely, the next release of Brave will include the ability to propagate data besides trace identifiers. If interested, watch the issue or chat with us on gitter.