Skip to content

Commit

Permalink
fix: performance regression in_span
Browse files Browse the repository at this point in the history
  • Loading branch information
robertlaurin committed Jul 17, 2023
1 parent 1159ec0 commit 38d5c04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/lib/opentelemetry/trace/tracer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Tracer
def in_span(name, attributes: nil, links: nil, start_timestamp: nil, kind: nil, &block)
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}")
Expand Down

0 comments on commit 38d5c04

Please sign in to comment.