Class: ElasticAPM::OpenTracing::Scope 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 Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(span, scope_stack, finish_on_close:) ⇒ Scope

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 Scope.



123
124
125
126
127
# File 'lib/elastic_apm/opentracing.rb', line 123

def initialize(span, scope_stack, finish_on_close:)
  @span = span
  @scope_stack = scope_stack
  @finish_on_close = finish_on_close
end

Instance Attribute Details

#spanObject (readonly)

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.



129
130
131
# File 'lib/elastic_apm/opentracing.rb', line 129

def span
  @span
end

Instance Method Details

#closeObject

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.



135
136
137
138
# File 'lib/elastic_apm/opentracing.rb', line 135

def close
  @span.finish if @finish_on_close
  @scope_stack.pop
end

#elastic_spanObject

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.



131
132
133
# File 'lib/elastic_apm/opentracing.rb', line 131

def elastic_span
  span.elastic_span
end