Skip to content

Brave 4.16

Compare
Choose a tag to compare
@codefromthecrypt codefromthecrypt released this 26 Feb 07:28
· 847 commits to master since this release

Brave 4.16 uses the http route when naming spans. It also adds Jersey server instrumentation.

http route

Zipkin 2.5 introduced a new tag "http.route", which is like "http.path" except it includes variable tokens. These allow the tag to be the same for requests that includes IDs.

An "http.route" could look like "/items/:itemId". Brave 4.5 adds support for parsing this, employing it as the default span name policy when present. A route based span name looks like "get /users/{userId}", "get not_found" or "get redirected". Please look at the docs for more details.

support

The following brave-based instrumentation support route-based span names. More soon!

credits

Both ratpack-zipkin and play-zipkin-tracing formerly used route-based span names. The mechanics for how we parse the name (ex on the response path) was a technique @llinder and @hyleung worked out in ratpack. This insight saved a lot of effort. The default naming strategy, notably redirect and not_found constants were via micrometer from @jkschneider.

Jersey server instrumentation

JAX-RS is a helpful specification, but it does not make error handling easy, nor does it allow you to access the path template declared on service interfaces.

Through discussion with @jplock, we decided to add jersey-server instrumentation.

This uses an application event listener to do a better job tracing
Jersey servers than what can be done with JAX-RS. For example, the event
listener can handle errors natively, and act more precisely with regards
to jersey-specifics like ManagedAsync.

This instrumentation is used by default in DropWizard Zipkin.

Other updates

The following are some other changes you may want to be aware of

  • "http.method" tag is now added by default (as it is not necessarily the same as the span name anymore)
  • @takezoe fixed generic result types of HttpServerHandler and HttpClientHandler.create() (helps in scala)
  • You can now parse more from the response HttpAdapter.methodFromResponse and HttpAdapter.route. These are used for the span name.
  • You can now parse the status code as an integer instead of boxing via statusCodeAsInt
  • The JAX-RS client filter is now public so you can install it alongside jersey server instrumentation, and without the container filter.