Class: NewRelic::Agent::OpenTelemetry::Trace::Span

Inherits:
OpenTelemetry::Trace::Span
  • Object
show all
Defined in:
lib/new_relic/agent/opentelemetry/trace/span.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#finishableObject

Returns the value of attribute finishable.



10
11
12
# File 'lib/new_relic/agent/opentelemetry/trace/span.rb', line 10

def finishable
  @finishable
end

Instance Method Details

#add_attributes(attributes) ⇒ Object



20
21
22
# File 'lib/new_relic/agent/opentelemetry/trace/span.rb', line 20

def add_attributes(attributes)
  NewRelic::Agent.add_custom_span_attributes(attributes)
end

#finish(end_timestamp: nil) ⇒ Object



12
13
14
# File 'lib/new_relic/agent/opentelemetry/trace/span.rb', line 12

def finish(end_timestamp: nil)
  finishable&.finish
end

#record_exception(exception, attributes: nil) ⇒ Object



24
25
26
# File 'lib/new_relic/agent/opentelemetry/trace/span.rb', line 24

def record_exception(exception, attributes: nil)
  NewRelic::Agent.notice_error(exception, attributes: attributes)
end

#set_attribute(key, value) ⇒ Object



16
17
18
# File 'lib/new_relic/agent/opentelemetry/trace/span.rb', line 16

def set_attribute(key, value)
  NewRelic::Agent.add_custom_span_attributes(key => value)
end