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

Constructor Details

#initialize(segment:, transaction:) ⇒ Span

Returns a new instance of Span.



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

def initialize(segment:, transaction:)
  @context = ::OpenTelemetry::Trace::SpanContext.new(
    trace_id: transaction.trace_id,
    span_id: segment.guid,
    trace_flags: 1
  )
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



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

def context
  @context
end