Class: Yes::Core::OpenTelemetry::OtlSpan::OtlData

Inherits:
Struct
  • Object
show all
Defined in:
lib/yes/core/open_telemetry/otl_span.rb

Overview

Configuration struct for OpenTelemetry span data

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(span_name: nil, span_kind: :internal, span_attributes: {}, links_extractor: proc { [] }, track_sql: false) ⇒ OtlData

Returns a new instance of OtlData.

Parameters:

  • span_name (String, nil) (defaults to: nil)

    name of the span

  • span_kind (Symbol) (defaults to: :internal)

    kind of span (:internal, :client, :server, :producer, :consumer)

  • span_attributes (Hash) (defaults to: {})

    additional span attributes

  • links_extractor (Proc) (defaults to: proc { [] })

    extracts OTL context links from arguments

  • track_sql (Boolean) (defaults to: false)

    whether to track SQL queries within the span



19
20
21
22
# File 'lib/yes/core/open_telemetry/otl_span.rb', line 19

def initialize(span_name: nil, span_kind: :internal, span_attributes: {}, links_extractor: proc { [] },
               track_sql: false)
  super
end

Instance Attribute Details

Returns the value of attribute links_extractor

Returns:

  • (Object)

    the current value of links_extractor



13
14
15
# File 'lib/yes/core/open_telemetry/otl_span.rb', line 13

def links_extractor
  @links_extractor
end

#span_attributesObject

Returns the value of attribute span_attributes

Returns:

  • (Object)

    the current value of span_attributes



13
14
15
# File 'lib/yes/core/open_telemetry/otl_span.rb', line 13

def span_attributes
  @span_attributes
end

#span_kindObject

Returns the value of attribute span_kind

Returns:

  • (Object)

    the current value of span_kind



13
14
15
# File 'lib/yes/core/open_telemetry/otl_span.rb', line 13

def span_kind
  @span_kind
end

#span_nameObject

Returns the value of attribute span_name

Returns:

  • (Object)

    the current value of span_name



13
14
15
# File 'lib/yes/core/open_telemetry/otl_span.rb', line 13

def span_name
  @span_name
end

#track_sqlObject

Returns the value of attribute track_sql

Returns:

  • (Object)

    the current value of track_sql



13
14
15
# File 'lib/yes/core/open_telemetry/otl_span.rb', line 13

def track_sql
  @track_sql
end