Class: Couchbase::OpenTelemetry::RequestSpan
- Inherits:
-
Tracing::RequestSpan
- Object
- Tracing::RequestSpan
- Couchbase::OpenTelemetry::RequestSpan
- Defined in:
- lib/couchbase/opentelemetry/request_span.rb
Instance Method Summary collapse
- #finish(end_timestamp: nil) ⇒ Object
-
#initialize(span) ⇒ RequestSpan
constructor
A new instance of RequestSpan.
- #set_attribute(key, value) ⇒ Object
- #status=(status_code) ⇒ Object
Constructor Details
#initialize(span) ⇒ RequestSpan
Returns a new instance of RequestSpan.
24 25 26 27 28 |
# File 'lib/couchbase/opentelemetry/request_span.rb', line 24 def initialize(span) super() @wrapped = span end |
Instance Method Details
#finish(end_timestamp: nil) ⇒ Object
44 45 46 |
# File 'lib/couchbase/opentelemetry/request_span.rb', line 44 def finish(end_timestamp: nil) @wrapped.finish(end_timestamp: ) end |
#set_attribute(key, value) ⇒ Object
30 31 32 |
# File 'lib/couchbase/opentelemetry/request_span.rb', line 30 def set_attribute(key, value) @wrapped.set_attribute(key, value) end |
#status=(status_code) ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/couchbase/opentelemetry/request_span.rb', line 34 def status=(status_code) @wrapped.status = if status_code == :ok ::OpenTelemetry::Trace::Status.ok elsif status_code == :error ::OpenTelemetry::Trace::Status.error else ::OpenTelemetry::Trace::Status.unset end end |