class Aws::Telemetry::OTelSpan

OpenTelemetry-based {SpanBase}, represents a single operation within a trace.

Public Class Methods

new(span) click to toggle source
Calls superclass method
# File lib/aws-sdk-core/telemetry/otel.rb, line 131
def initialize(span)
  super()
  @span = span
end

Public Instance Methods

[]=(key, value)
Alias for: set_attribute
add_attributes(attributes) click to toggle source

Add attributes.

@param [Hash{String => String, Numeric, Boolean, Array<String, Numeric,

Boolean>}] attributes Values must be non-nil and (array of) string,
boolean or numeric type. Array values must not contain nil elements
and all elements must be of the same basic type (string, numeric,
boolean)

@return [self] returns itself

# File lib/aws-sdk-core/telemetry/otel.rb, line 157
def add_attributes(attributes)
  @span.add_attributes(attributes)
end
add_event(name, attributes: nil) click to toggle source

Add event to a Span.

@param [String] name Name of the event @param [Hash{String => String, Numeric, Boolean, Array<String,

Numeric, Boolean>}] attributes Values must be non-nil and (array of)
string, boolean or numeric type. Array values must not contain nil
elements and all elements must be of the same basic type (string,
numeric, boolean)

@return [self] returns itself

# File lib/aws-sdk-core/telemetry/otel.rb, line 170
def add_event(name, attributes: nil)
  @span.add_event(name, attributes: attributes)
end
finish(end_timestamp: nil) click to toggle source

Finishes the Span.

@param [Time] end_timestamp End timestamp for the span @return [self] returns itself

# File lib/aws-sdk-core/telemetry/otel.rb, line 187
def finish(end_timestamp: nil)
  @span.finish(end_timestamp: end_timestamp)
end
record_exception(exception, attributes: nil) click to toggle source

Record an exception during the execution of this span. Multiple exceptions can be recorded on a span.

@param [Exception] exception The exception to be recorded @param [Hash{String => String, Numeric, Boolean, Array<String,

Numeric, Boolean>}] attributes One or more key:value pairs, where the
keys must be strings and the values may be (array of) string, boolean
or numeric type

@return [void]

# File lib/aws-sdk-core/telemetry/otel.rb, line 200
def record_exception(exception, attributes: nil)
  @span.record_exception(exception, attributes: attributes)
end
set_attribute(key, value) click to toggle source

Set attribute.

@param [String] key @param [String, Boolean, Numeric, Array<String, Numeric, Boolean>] value

Value must be non-nil and (array of) string, boolean or numeric type.
Array values must not contain nil elements and all elements must be of
the same basic type (string, numeric, boolean)

@return [self] returns itself

# File lib/aws-sdk-core/telemetry/otel.rb, line 144
def set_attribute(key, value)
  @span.set_attribute(key, value)
end
Also aliased as: []=
status=(status) click to toggle source

Sets the Span status.

@param [Aws::Telemetry::Status] status The new status, which

overrides the default Span status, which is `OK`

@return [void]

# File lib/aws-sdk-core/telemetry/otel.rb, line 179
def status=(status)
  @span.status = status
end