Class: OpenTracing::ScopeManager

Inherits:
Object
  • Object
show all
Defined in:
lib/opentracing/scope_manager.rb

Overview

ScopeManager represents an OpenTracing ScopeManager

See www.opentracing.io for more information.

The ScopeManager interface abstracts both the activation of Span instances via ScopeManager#activate and access to an active Span/Scope via ScopeManager#active

Constant Summary collapse

NOOP_INSTANCE =
ScopeManager.new.freeze

Instance Method Summary collapse

Instance Method Details

#activate(span, finish_on_close: true) ⇒ Scope

Make a span instance active.

Parameters:

  • span (Span)

    the Span that should become active

  • finish_on_close (Boolean) (defaults to: true)

    whether the Span should automatically be finished when Scope#close is called

Returns:

  • (Scope)

    instance to control the end of the active period for the Span. It is a programming error to neglect to call Scope#close on the returned instance.



21
22
23
# File 'lib/opentracing/scope_manager.rb', line 21

def activate(span, finish_on_close: true)
  Scope::NOOP_INSTANCE
end

#activeScope

currently active Span.

If there is a non-null Scope, its wrapped Span becomes an implicit parent (as Reference#CHILD_OF) of any newly-created Span at Tracer#start_active_span or Tracer#start_span time.

Returns:

  • (Scope)

    the currently active Scope which can be used to access the



31
32
33
# File 'lib/opentracing/scope_manager.rb', line 31

def active
  Scope::NOOP_INSTANCE
end