Class: ElasticAPM::Instrumenter::Current Private

Inherits:
Object
  • Object
show all
Defined in:
lib/elastic_apm/instrumenter.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

#initializeCurrent

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



19
20
21
22
# File 'lib/elastic_apm/instrumenter.rb', line 19

def initialize
  self.transaction = nil
  self.spans = []
end

Instance Method Details

#spansObject

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.



32
33
34
# File 'lib/elastic_apm/instrumenter.rb', line 32

def spans
  Thread.current[SPAN_KEY] ||= []
end

#spans=(spans) ⇒ 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.



36
37
38
39
# File 'lib/elastic_apm/instrumenter.rb', line 36

def spans=(spans)
  Thread.current[SPAN_KEY] ||= []
  Thread.current[SPAN_KEY] = spans
end

#transactionObject

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.



24
25
26
# File 'lib/elastic_apm/instrumenter.rb', line 24

def transaction
  Thread.current[TRANSACTION_KEY]
end

#transaction=(transaction) ⇒ 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.



28
29
30
# File 'lib/elastic_apm/instrumenter.rb', line 28

def transaction=(transaction)
  Thread.current[TRANSACTION_KEY] = transaction
end