Method: OpenTelemetry::Trace::Link#initialize

Defined in:
lib/opentelemetry/trace/link.rb

#initialize(span_context, attributes = nil) ⇒ Link

Returns a new immutable OpenTelemetry::Trace::Link.

Parameters:

  • span_context (SpanContext)

    The context of the linked Span.

  • attributes (optional Hash{String => String, Numeric, Boolean, Array<String, Numeric, Boolean>}) (defaults to: nil)

    A hash of attributes for this link. Attributes will be frozen during Link initialization.



35
36
37
38
# File 'lib/opentelemetry/trace/link.rb', line 35

def initialize(span_context, attributes = nil)
  @span_context = span_context
  @attributes = attributes.freeze || EMPTY_ATTRIBUTES
end