Class: Labkit::Tracing::Adapters::OpentelemetryTracer::OpenTelemetryScope Private
- Inherits:
-
Object
- Object
- Labkit::Tracing::Adapters::OpentelemetryTracer::OpenTelemetryScope
- Defined in:
- lib/labkit/tracing/adapters/opentelemetry_tracer.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #span ⇒ Object readonly private
Instance Method Summary collapse
- #close ⇒ Object private
-
#initialize(raw_span, token) ⇒ OpenTelemetryScope
constructor
private
A new instance of OpenTelemetryScope.
- #log_event(name, **attributes) ⇒ Object private
- #set_error(exception) ⇒ Object private
- #set_tag(key, value) ⇒ Object private
Constructor Details
#initialize(raw_span, token) ⇒ OpenTelemetryScope
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of OpenTelemetryScope.
88 89 90 91 92 |
# File 'lib/labkit/tracing/adapters/opentelemetry_tracer.rb', line 88 def initialize(raw_span, token) @span = OpentelemetrySpan.new(raw_span) @raw_span = raw_span @token = token end |
Instance Attribute Details
#span ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
86 87 88 |
# File 'lib/labkit/tracing/adapters/opentelemetry_tracer.rb', line 86 def span @span end |
Instance Method Details
#close ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
106 107 108 109 |
# File 'lib/labkit/tracing/adapters/opentelemetry_tracer.rb', line 106 def close @raw_span.finish OpenTelemetry::Context.detach(@token) end |
#log_event(name, **attributes) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
102 103 104 |
# File 'lib/labkit/tracing/adapters/opentelemetry_tracer.rb', line 102 def log_event(name, **attributes) span.log_event(name, **attributes) end |
#set_error(exception) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
98 99 100 |
# File 'lib/labkit/tracing/adapters/opentelemetry_tracer.rb', line 98 def set_error(exception) span.set_error(exception) end |
#set_tag(key, value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
94 95 96 |
# File 'lib/labkit/tracing/adapters/opentelemetry_tracer.rb', line 94 def set_tag(key, value) span.set_tag(key, value) end |