Skip to content

Commit

Permalink
fix: performance regression in_span (#1492)
Browse files Browse the repository at this point in the history
* fix: performance regression in_span

* chore: disable bad cop
  • Loading branch information
robertlaurin authored Aug 15, 2023
1 parent ccad50f commit d003724
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions api/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ Style/StringConcatenation:
- "test/**/*"
Style/ModuleFunction:
Enabled: false
Style/ExplicitBlockArgument:
Enabled: false
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 d003724

Please sign in to comment.