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.



166
167
168
# File 'lib/elastic_apm/opentracing.rb', line 166

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.



170
171
172
173
174
175
176
# File 'lib/elastic_apm/opentracing.rb', line 170

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.



178
179
180
# File 'lib/elastic_apm/opentracing.rb', line 178

def active
  @scope_stack.last
end