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, tolerated_errors: {}) ⇒ 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

  • tolerated_errors (Hash{Class => String}) (defaults to: {}) —

    errors that are re-raised but do not mark the span as failed; the span gets the mapped value as its outcome attribute instead



33
34
35
36
# File 'lib/yes/core/open_telemetry/otl_span.rb', line 33

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

Instance Attribute Details

Returns the value of attribute links_extractor

Returns:

  • (Object) —

    the current value of links_extractor



24
25
26
# File 'lib/yes/core/open_telemetry/otl_span.rb', line 24

def links_extractor
  @links_extractor
end

#span_attributes ⇒ Object

Returns the value of attribute span_attributes

Returns:

  • (Object) —

    the current value of span_attributes



24
25
26
# File 'lib/yes/core/open_telemetry/otl_span.rb', line 24

def span_attributes
  @span_attributes
end

#span_kind ⇒ Object

Returns the value of attribute span_kind

Returns:

  • (Object) —

    the current value of span_kind



24
25
26
# File 'lib/yes/core/open_telemetry/otl_span.rb', line 24

def span_kind
  @span_kind
end

#span_name ⇒ Object

Returns the value of attribute span_name

Returns:

  • (Object) —

    the current value of span_name



24
25
26
# File 'lib/yes/core/open_telemetry/otl_span.rb', line 24

def span_name
  @span_name
end

#tolerated_errors ⇒ Object

Returns the value of attribute tolerated_errors

Returns:

  • (Object) —

    the current value of tolerated_errors



24
25
26
# File 'lib/yes/core/open_telemetry/otl_span.rb', line 24

def tolerated_errors
  @tolerated_errors
end

#track_sql ⇒ Object

Returns the value of attribute track_sql

Returns:

  • (Object) —

    the current value of track_sql



24
25
26
# File 'lib/yes/core/open_telemetry/otl_span.rb', line 24

def track_sql
  @track_sql
end