Class: ElasticAPM::OpenTracing::ScopeManager Private

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initializeScopeManager

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ScopeManager.



196
197
198
# File 'lib/elastic_apm/opentracing.rb', line 196

def initialize
  @scope_stack = ScopeStack.new
end

Instance Method Details

#activate(span, finish_on_close: true) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



200
201
202
203
204
205
206
# File 'lib/elastic_apm/opentracing.rb', line 200

def activate(span, finish_on_close: true)
  return active if active && active.span == span

  scope = Scope.new(span, @scope_stack, finish_on_close: finish_on_close)
  @scope_stack.push scope
  scope
end

#activeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



208
209
210
# File 'lib/elastic_apm/opentracing.rb', line 208

def active
  @scope_stack.last
end