Class: Aws::Telemetry::OTelSpan
- Defined in:
- lib/aws-sdk-core/telemetry/otel.rb
Overview
OpenTelemetry-based SpanBase, represents a single operation within a trace.
Instance Method Summary collapse
- 
  
    
      #add_attributes(attributes)  ⇒ self 
    
    
  
  
  
  
  
  
  
  
  
    Add attributes. 
- 
  
    
      #add_event(name, attributes: nil)  ⇒ self 
    
    
  
  
  
  
  
  
  
  
  
    Add event to a Span. 
- 
  
    
      #finish(end_timestamp: nil)  ⇒ self 
    
    
  
  
  
  
  
  
  
  
  
    Finishes the Span. 
- 
  
    
      #initialize(span)  ⇒ OTelSpan 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of OTelSpan. 
- 
  
    
      #record_exception(exception, attributes: nil)  ⇒ void 
    
    
  
  
  
  
  
  
  
  
  
    Record an exception during the execution of this span. 
- 
  
    
      #set_attribute(key, value)  ⇒ self 
    
    
      (also: #[]=)
    
  
  
  
  
  
  
  
  
  
    Set attribute. 
- 
  
    
      #status=(status)  ⇒ void 
    
    
  
  
  
  
  
  
  
  
  
    Sets the Span status. 
Constructor Details
#initialize(span) ⇒ OTelSpan
Returns a new instance of OTelSpan.
| 131 132 133 134 | # File 'lib/aws-sdk-core/telemetry/otel.rb', line 131 def initialize(span) super() @span = span end | 
Instance Method Details
#add_attributes(attributes) ⇒ self
Add attributes.
| 157 158 159 | # File 'lib/aws-sdk-core/telemetry/otel.rb', line 157 def add_attributes(attributes) @span.add_attributes(attributes) end | 
#add_event(name, attributes: nil) ⇒ self
Add event to a Span.
| 170 171 172 | # 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) ⇒ self
Finishes the Span.
| 187 188 189 | # File 'lib/aws-sdk-core/telemetry/otel.rb', line 187 def finish(end_timestamp: nil) @span.finish(end_timestamp: ) end | 
#record_exception(exception, attributes: nil) ⇒ void
This method returns an undefined value.
Record an exception during the execution of this span. Multiple exceptions can be recorded on a span.
| 200 201 202 | # 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) ⇒ self Also known as: []=
Set attribute.
| 144 145 146 | # File 'lib/aws-sdk-core/telemetry/otel.rb', line 144 def set_attribute(key, value) @span.set_attribute(key, value) end | 
#status=(status) ⇒ void
This method returns an undefined value.
Sets the Span status.
| 179 180 181 | # File 'lib/aws-sdk-core/telemetry/otel.rb', line 179 def status=(status) @span.status = status end |