Class: Buildkite::Trace::Span
- Inherits:
-
Object
- Object
- Buildkite::Trace::Span
- Defined in:
- lib/buildkite/trace/span.rb
Overview
A value object to hold the data we will submit to datadog
Instance Attribute Summary collapse
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#metrics ⇒ Object
readonly
Returns the value of attribute metrics.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent_id ⇒ Object
readonly
Returns the value of attribute parent_id.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
-
#span_id ⇒ Object
readonly
Returns the value of attribute span_id.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
-
#trace_id ⇒ Object
readonly
Returns the value of attribute trace_id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(trace_id:, span_id:, parent_id:, name:, resource:, service:, type:, start:, duration:, metrics:, meta:) ⇒ Span
constructor
A new instance of Span.
- #to_hash ⇒ Object
Constructor Details
#initialize(trace_id:, span_id:, parent_id:, name:, resource:, service:, type:, start:, duration:, metrics:, meta:) ⇒ Span
Returns a new instance of Span.
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/buildkite/trace/span.rb', line 8 def initialize(trace_id:, span_id:, parent_id:, name:, resource:, service:, type:, start:, duration:, metrics:, meta:) @trace_id = trace_id @span_id = span_id @parent_id = parent_id @name = name @resource = resource @service = service @type = type @start = start @duration = duration @metrics = metrics @meta = end |
Instance Attribute Details
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
6 7 8 |
# File 'lib/buildkite/trace/span.rb', line 6 def duration @duration end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
6 7 8 |
# File 'lib/buildkite/trace/span.rb', line 6 def @meta end |
#metrics ⇒ Object (readonly)
Returns the value of attribute metrics.
6 7 8 |
# File 'lib/buildkite/trace/span.rb', line 6 def metrics @metrics end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/buildkite/trace/span.rb', line 5 def name @name end |
#parent_id ⇒ Object (readonly)
Returns the value of attribute parent_id.
5 6 7 |
# File 'lib/buildkite/trace/span.rb', line 5 def parent_id @parent_id end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
5 6 7 |
# File 'lib/buildkite/trace/span.rb', line 5 def resource @resource end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
6 7 8 |
# File 'lib/buildkite/trace/span.rb', line 6 def service @service end |
#span_id ⇒ Object (readonly)
Returns the value of attribute span_id.
5 6 7 |
# File 'lib/buildkite/trace/span.rb', line 5 def span_id @span_id end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
6 7 8 |
# File 'lib/buildkite/trace/span.rb', line 6 def start @start end |
#trace_id ⇒ Object (readonly)
Returns the value of attribute trace_id.
5 6 7 |
# File 'lib/buildkite/trace/span.rb', line 5 def trace_id @trace_id end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/buildkite/trace/span.rb', line 6 def type @type end |
Instance Method Details
#to_hash ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/buildkite/trace/span.rb', line 22 def to_hash { trace_id: trace_id, span_id: span_id, parent_id: parent_id, name: name, resource: resource, service: service, type: @type, start: start, duration: duration, metrics: metrics, meta: , } end |