lib/opentelemetry/trace/tracer.rb in opentelemetry-api-1.2.1 vs lib/opentelemetry/trace/tracer.rb in opentelemetry-api-1.2.2
- old
+ new
@@ -29,13 +29,13 @@
# @param start_timestamp [optional Integer] nanoseconds since Epoch
# @param kind [optional Symbol] One of :internal, :server, :client, :producer, :consumer
#
# @yield [span, context] yields the newly created span and a context containing the
# span to the block.
- def in_span(name, attributes: nil, links: nil, start_timestamp: nil, kind: nil, &block)
+ def in_span(name, attributes: nil, links: nil, start_timestamp: nil, kind: nil)
span = nil
span = start_span(name, attributes: attributes, links: links, start_timestamp: start_timestamp, kind: kind)
- Trace.with_span(span, &block)
+ Trace.with_span(span) { |s, c| yield s, c }
rescue Exception => e # rubocop:disable Lint/RescueException
span&.record_exception(e)
span&.status = Status.error("Unhandled exception of type: #{e.class}")
raise e
ensure