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
Tracking Issue: motivation, proposals, and pull requests.
Please check out the io.opentracing.testbed package for common instrumentation patterns.