class Aws::Telemetry::OTelSpan
OpenTelemetry-based {SpanBase}, represents a single operation within a trace.
Public Class Methods
Source
# File lib/aws-sdk-core/telemetry/otel.rb, line 131 def initialize(span) super() @span = span end
Public Instance Methods
Source
# File lib/aws-sdk-core/telemetry/otel.rb, line 157 def add_attributes(attributes) @span.add_attributes(attributes) end
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
Source
# File lib/aws-sdk-core/telemetry/otel.rb, line 170 def add_event(name, attributes: nil) @span.add_event(name, attributes: attributes) end
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
Source
# File lib/aws-sdk-core/telemetry/otel.rb, line 187 def finish(end_timestamp: nil) @span.finish(end_timestamp: end_timestamp) end
Finishes the Span.
@param [Time] end_timestamp End timestamp for the span @return [self] returns itself
Source
# File lib/aws-sdk-core/telemetry/otel.rb, line 200 def record_exception(exception, attributes: nil) @span.record_exception(exception, attributes: attributes) end
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]
Source
# File lib/aws-sdk-core/telemetry/otel.rb, line 144 def set_attribute(key, value) @span.set_attribute(key, value) end
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
Source
# File lib/aws-sdk-core/telemetry/otel.rb, line 179 def status=(status) @span.status = status end
Sets the Span status.
@param [Aws::Telemetry::Status] status The new status, which
overrides the default Span status, which is `OK`
@return [void]