class Aws::Telemetry::OTelTracer

OpenTelemetry-based {TracerBase}, responsible for creating spans.

def current_span

Returns:
  • (Aws::Telemetry::OTelSpan) -
def current_span
  OTelSpan.new(OpenTelemetry::Trace.current_span)
end

def in_span(name, attributes: nil, kind: nil, &block)

Returns:
  • (Aws::Telemetry::OTelSpan) -

Parameters:
  • kind (Aws::Telemetry::SpanKind) -- Type of Span
  • attributes (Hash) -- Attributes to attach to the span
  • name (String) -- Span name
def in_span(name, attributes: nil, kind: nil, &block)
  @tracer.in_span(name, attributes: attributes, kind: kind) do |span|
    block.call(OTelSpan.new(span))
  end
end

def initialize(tracer)

def initialize(tracer)
  super()
  @tracer = tracer
end

def start_span(name, with_parent: nil, attributes: nil, kind: nil)

Returns:
  • (Aws::Telemetry::OTelSpan) -

Parameters:
  • kind (Aws::Telemetry::SpanKind) -- Type of Span
  • attributes (Hash) -- Attributes to attach to the span
  • with_parent (Object) -- Parent Context
  • name (String) -- Span name
def start_span(name, with_parent: nil, attributes: nil, kind: nil)
  span = @tracer.start_span(
    name,
    with_parent: with_parent,
    attributes: attributes,
    kind: kind
  )
  OTelSpan.new(span)
end