Skip to content

Brave v4.1

Compare
Choose a tag to compare
@codefromthecrypt codefromthecrypt released this 03 Apr 09:17
· 1153 commits to master since this release

Brave v4.1 introduces SparkJava and deprecates Apache CXF instrumentation. It also adds a new api to replace the ThreadBinder apis present in prior versions.

SparkJava

SparkJava integration has been requested multiple times over the last year. Thanks to effort by @songxin1990, you can setup tracing in only a few lines.

BraveTracing tracing = BraveTracing.create(brave);
Spark.before(tracing.before());
Spark.exception(Exception.class, tracing.exception(new ExceptionHandlerImpl()));
Spark.afterAfter(tracing.afterAfter());

CXF

Apache CXF started in Brave, but thanks to @reta is now in the upstream project. Please stop using brave-cxf3 in favor of CXF's built-in Brave tracing integration.

Current Span

Many of you started using the new Brave 4 Tracing apis. One element missing from this was how to propagate a trace context across threads. Starting in Brave 4.1, there are utilities like Tracer.currentSpan() and Tracer.nextSpan() which rely on a plugin called CurrentTraceContext.

https://github.com/openzipkin/brave/tree/master/brave#current-span

CurrentTraceContext can be customized to integrate with SLF4J or even share data with other tracing systems like Finagle. Check out our feature tests for how this works.

This feature was a long time coming and is a key dependency of Brave 4.x modernization which should be feature complete by v4.2. Many thanks to those who participated in the design and code review, particularly @bogdandrutu @cschneider @devinsba @eirslett @kmaci3k @llinder @reta @smaldini and @tramchamploo