First Release Candidate for OpenTracing-Python 2.0.0

Ted Young
OpenTracing
Published in
2 min readFeb 21, 2018

--

The release candidate for the 2.0.0 version of Python OpenTracing is now available.

The Scopes approach for context propagation has been adopted from Java 0.31. For asynchronous code, span lifecycle management is now handled in framework instrumentation rather than tracer internals (through specific implementations of ScopeManager).

At this time, we recommend tracer implementers start porting to the new API and check out the backwards compatibility layer, while instrumentation maintainers begin preparing a v2.0.0 version of their library on a branch tagged with ot_v2.0.0 .

Changes from v1.3.0 to v2.0.0-rc1

  • Scope and ScopeManager added to the API.
  • A Scope represents an execution context. Each Scope contains a Span, and is deactivated when Scope.close() is called.
  • ScopeManager.activate(span, finish_on_close) associates a Span with the current context, returning a new Scope.
  • ScopeManager.active() returns the currently active Scope, or else None.
  • Tracer.start_active_span() creates a new Span and automatically activates it.
  • Tracer.start_span() and Tracer.start_active_span() will automatically use the current active Span as a parent, unless the programmer passes a specified parent context or sets ignore_active_span=True.

Changes from BasicTracer v2.2.0 to v3.0.0-rc1

  • Updated the API to use ScopeManager.
  • ThreadLocalScopeManager added as ScopeManager implementation using thread-local storage.

General notes

  • We used properties instead of methods where possible (Tracer.scopeManager, Scope.span, for example). This is done to preserve the current coding style we have on elements such as Span.context and Span.manager.

Release Artifacts

Release Candidate Branch
https://github.com/opentracing/opentracing-python/tree/v2.0.0
https://github.com/opentracing/basictracer-python/tree/v3.0.0

PyPi Package
https://pypi.python.org/pypi/opentracing/2.0.0rc1
https://pypi.python.org/pypi/basictracer/3.0.0rc1

Tracking Issue: Motivation, Proposals, and Pull Requests.
https://github.com/opentracing/opentracing-python/issues/65

Thanks to Emanuele Palazzetti and Carlos Alberto, the primary authors of this release!

--

--

Ted Young
OpenTracing

Tracing all the things. Director of Developer Education at Lightstep. All purpose OpenTelemetry contributor.