Brave v4.3
Brave v4.3 includes new instrumentation for common libraries like servlet and JDBC.
We've had high demand to redo our instrumentation over Brave's new apis like brave.Tracer
. It took time to put these together the right way, with buy-in from users. Thanks to input and contributions from @jplock @pavolloffay @llinder @devinsba @reta @hyleung @felixbarny @SirTyro and @garyd203, the following are now in place.
Instrumentation
The following decorate commonly used libraries such that trace data end up in Zipkin. Notably, http libraries have portable configuration. This lets you do things like map a custom header as a span tag, and have that work for all libraries.
- grpc - Tracing client and server interceptors for grpc
- httpasyncclient - Tracing decorator for Apache HttpClient 4.0+
- httpclient - Tracing decorator for Apache HttpClient 4.3+
- jaxrs2 - Tracing filters and a feature to automatically configure them
- mysql - Tracing MySQL statement interceptor
- okhttp3 - Tracing decorators for OkHttp 3.x
- p6spy - Tracing event listener for P6Spy (a proxy for calls to your JDBC driver)
- servlet - Tracing filter for Servlet 2.5+ (including Async)
- sparkjava - Tracing filters and exception handlers for SparkJava
- spring-web - Tracing interceptor for Spring RestTemplate
- spring-webmvc - Tracing interceptor for Spring WebMVC
Note: While many of the above now do new things like async tracing, we still have users who trace legacy apps. Notably, our Servlet and Spring instrumentation remain compatible with JRE 6 and Servlet 2.5. Our example shows how to trace an XML-configured app.
Configuration
- brave-context-log4j12 - adds trace and span IDs to the Log4J v1.2 Mapped Diagnostic Context (MDC)
- brave-context-log4j2 - adds trace and span IDs to the Log4J v2 Thread Context
- brave-context-slf4j - adds trace and span IDs to the SLF4J Mapped Diagnostic Context (MDC)
- brave-spring-beans - This allows you to setup tracing with XML instead of custom code.
See also
While there are a significant amount of instrumentation here, many exist in community repos. Some have already or are in the process of moving to Brave v4 apis. For example, watch out for ratpack, play and cassandra. Regardless, if you can help with things we are missing, please raise a pull request or let us know what you are working on via gitter.
Note
Brave 4.3.1 is the minimum version you should use, as this includes adjustments from early users of Brave 4.3.0.