class OpenTelemetry::Trace::Status
Status
represents the status of a finished {Span}. It is composed of a status code in conjunction with an optional descriptive message.
Constants
- ERROR
An error.
- OK
The operation completed successfully.
- UNSET
The default status.
Attributes
code[R]
Retrieve the status code of this Status
.
@return [Integer]
description[R]
Retrieve the description of this Status
.
@return [String]
Public Class Methods
new(code, description: '')
click to toggle source
Initialize a Status
.
@param [Integer] code One of the status codes below @param [String] description
# File lib/opentelemetry/trace/status.rb, line 31 def initialize(code, description: '') @code = code @description = description end
Public Instance Methods
ok?()
click to toggle source
Returns false if this {Status} represents an error, else returns true.
@return [Boolean]
# File lib/opentelemetry/trace/status.rb, line 39 def ok? @code != ERROR end