lib/opentelemetry/instrumentation/rack/middlewares/tracer_middleware.rb in opentelemetry-instrumentation-rack-0.7.0 vs lib/opentelemetry/instrumentation/rack/middlewares/tracer_middleware.rb in opentelemetry-instrumentation-rack-0.8.0
- old
+ new
@@ -85,18 +85,14 @@
attributes: {
'start_time' => request_start_time.to_f
},
kind: :server)
- extracted_context.set_value(current_span_key, span)
+ OpenTelemetry::Trace.context_with_span(span, parent_context: extracted_context)
end
def finish_span(context)
- context[current_span_key]&.finish if context
- end
-
- def current_span_key
- OpenTelemetry::Trace::Propagation::ContextKeys.current_span_key
+ OpenTelemetry::Trace.current_span(context).finish if context
end
def tracer
OpenTelemetry::Instrumentation::Rack::Instrumentation.instance.tracer
end