diff --git a/api/.rubocop.yml b/api/.rubocop.yml index 48b15eb667..8b011887ff 100644 --- a/api/.rubocop.yml +++ b/api/.rubocop.yml @@ -24,3 +24,5 @@ Style/StringConcatenation: - "test/**/*" Style/ModuleFunction: Enabled: false +Style/ExplicitBlockArgument: + Enabled: false diff --git a/api/lib/opentelemetry/trace/tracer.rb b/api/lib/opentelemetry/trace/tracer.rb index edac704738..3545c432fe 100644 --- a/api/lib/opentelemetry/trace/tracer.rb +++ b/api/lib/opentelemetry/trace/tracer.rb @@ -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}")