Class: Insika::Telemetry::OTelTracer
- Inherits:
-
Object
- Object
- Insika::Telemetry::OTelTracer
- Defined in:
- lib/insika/telemetry.rb
Overview
Translates the Recorder's duck-typed contract to the OTEL tracer.
Instance Method Summary collapse
-
#initialize(otel) ⇒ OTelTracer
constructor
A new instance of OTelTracer.
- #start_span(name, parent:, attributes:, start_time:) ⇒ Object
Constructor Details
#initialize(otel) ⇒ OTelTracer
Returns a new instance of OTelTracer.
110 |
# File 'lib/insika/telemetry.rb', line 110 def initialize(otel) = (@otel = otel) |
Instance Method Details
#start_span(name, parent:, attributes:, start_time:) ⇒ Object
112 113 114 115 |
# File 'lib/insika/telemetry.rb', line 112 def start_span(name, parent:, attributes:, start_time:) ctx = parent ? OpenTelemetry::Trace.context_with_span(parent.raw) : OpenTelemetry::Context.current OTelSpan.new(@otel.start_span(name, with_parent: ctx, attributes: attributes, start_timestamp: start_time)) end |