Class: Labkit::Tracing::Adapters::OpentelemetryTracer::OpenTelemetryScope Private

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#spanObject (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

#closeObject

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
97
# File 'lib/labkit/tracing/adapters/opentelemetry_tracer.rb', line 94

def close
  @raw_span.finish
  OpenTelemetry::Context.detach(@token)
end