lib/opentelemetry/instrumentation/que/middlewares/server_middleware.rb in opentelemetry-instrumentation-que-0.7.0 vs lib/opentelemetry/instrumentation/que/middlewares/server_middleware.rb in opentelemetry-instrumentation-que-0.7.1
- old
+ new
@@ -18,18 +18,18 @@
extracted_context = extract_context_from_tags(job.que_attrs[:data][:tags] || [])
OpenTelemetry::Context.with_current(extracted_context) do
if otel_config[:propagation_style] == :child
tracer.in_span(span_name, attributes: attributes, kind: :consumer) do |span|
- block.call
+ yield
enhance_span_after_job_completion(span, job)
end
else
span_links = otel_config[:propagation_style] == :link ? prepare_span_links(extracted_context) : []
root_span = tracer.start_root_span(span_name, attributes: attributes, links: span_links, kind: :consumer)
OpenTelemetry::Trace.with_span(root_span) do |span|
- block.call
+ yield
enhance_span_after_job_completion(span, job)
ensure
root_span.finish
end
end