Class: ElasticAPM::Span::Context Private

Inherits:
Object
  • Object
show all
Defined in:
lib/elastic_apm/span/context.rb,
lib/elastic_apm/span/context/db.rb,
lib/elastic_apm/span/context/http.rb,
lib/elastic_apm/span/context/links.rb,
lib/elastic_apm/span/context/message.rb,
lib/elastic_apm/span/context/service.rb,
lib/elastic_apm/span/context/destination.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.

Defined Under Namespace

Classes: Db, Destination, Http, Links, Message, Service

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(db: nil, destination: nil, http: nil, labels: {}, sync: nil, message: nil, service: nil, links: nil) ⇒ Context

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



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/elastic_apm/span/context.rb', line 24

def initialize(
  db: nil,
  destination: nil,
  http: nil,
  labels: {},
  sync: nil,
  message: nil,
  service: nil,
  links: nil
)
  @sync = sync
  @db = db && Db.new(**db)
  @http = http && Http.new(**http)
  @destination =
    case destination
    when Destination then destination
    when Hash then Destination.new(**destination)
    end
  @message =
    case message
    when Message then message
    when Hash then Message.new(**message)
    end
  @labels = labels
  @service =
    case service
    when Service then service
    when Hash then Service.new(**service)
    end
  @links =
    case links
    when Links then links
    when Array then Links.new(links)
    end
end

Instance Attribute Details

#dbObject (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.



60
61
62
# File 'lib/elastic_apm/span/context.rb', line 60

def db
  @db
end

#destinationObject

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.



69
70
71
# File 'lib/elastic_apm/span/context.rb', line 69

def destination
  @destination
end

#httpObject (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.



60
61
62
# File 'lib/elastic_apm/span/context.rb', line 60

def http
  @http
end

#labelsObject (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.



60
61
62
# File 'lib/elastic_apm/span/context.rb', line 60

def labels
  @labels
end

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.



60
61
62
# File 'lib/elastic_apm/span/context.rb', line 60

def links
  @links
end

#messageObject (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.



60
61
62
# File 'lib/elastic_apm/span/context.rb', line 60

def message
  @message
end

#serviceObject

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.



69
70
71
# File 'lib/elastic_apm/span/context.rb', line 69

def service
  @service
end

#syncObject (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.



60
61
62
# File 'lib/elastic_apm/span/context.rb', line 60

def sync
  @sync
end