Carlos Alberto Cortez
Jan 22 · 2 min read

The second release candidate for the v0.32 version of Java OpenTracing is now available. After iterating over Release Candidate 1 several changes have been made, including deprecating ScopeManager.active() and splitting the context propagation interfaces into injection and extraction. You can find the updated summary of changes below.

Trace identifiers have been added, in order to make it possible to correlate Span objects.

Finishing Span objects upon Scope close has been deprecated, as doing it through try-with statements would make it hard to properly handle errors (Span objects would get finished before a catch block would be reached). This improves API safety, and makes it more difficult to do the wrong thing and end up with unexpected errors.

Changes from v0.31

  • Tracer identifiers were added through SpanContext.toTraceId() and SpanContext.toSpanId().
  • ScopeManager.active() has been deprecated. This was done to prevent users from accidentally closing Scope objects that they didn’t own.
  • ScopeManager.activate(Span, bool) has been deprecated.
  • SpanBuilder.startActive(bool) has been deprecated.
  • Scope.span() has been deprecated. This was done to prevent the user from passing Scope objects between threads (Scope objects are not guaranteed to be thread-safe). Now Scope will be responsible for Span deactivation only, instead of being Span containers.
  • ScopeManager.activeSpan() exposes the currently active Span, if any (ScopeManager.active() will reference its corresponding Scope object).
  • Tracer.activateSpan() is a shortcut for Tracer.scopeManager().activateSpan().
  • Updated BINARY format, notifying the user the requested byte length on Tracer.inject() time (before, required byte length was unknown and the user had to try to pass a ByteBuffer with enough free space).
  • User-friendly Tag setters for Span and SpanBuilder.
  • It’s now possible to pass Map<String, Object> (besides Map<String, String>) when using Tracer.inject() with TEXT_MAP/HTTP_HEADERS formats.
  • TextMap format interface now inherits from TextMapInject and TextMapExtract, as the Binary format interface inherits from BinaryInject and BinaryExtract. This was done to separate concerns between injection and extraction, allowing more flexibility for users writing adapters for extraction-only or injection-only scenarios.

Details on v0.32

Release Candidate Branch

https://github.com/opentracing/opentracing-java/tree/v0.32.0

Maven Artifact

https://mvnrepository.com/artifact/io.opentracing/opentracing-api/0.32.0-RC2

Tracking Issue: motivation, proposals, and pull requests.

https://github.com/opentracing/opentracing-java/issues/314

Please check out the io.opentracing.testbed package for common instrumentation patterns.

OpenTracing

A blog discussing distributed tracing and context propagation

Carlos Alberto Cortez

Written by

OpenTracing

A blog discussing distributed tracing and context propagation

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade