Issue Description
|
def with_child_span(**attributes, &block) |
|
current_span = get_current_scope.get_span |
|
|
|
if current_span |
|
result = nil |
|
|
|
begin |
|
current_span.with_child_span(**attributes) do |child_span| |
|
get_current_scope.set_span(child_span) |
|
result = yield(child_span) |
|
end |
|
ensure |
|
get_current_scope.set_span(current_span) |
|
end |
|
|
|
result |
|
else |
|
yield(nil) |
|
end |
|
end |
The get_current_scope will return nil before initialized then the with_child_span will failed.
Reproduction Steps
require 'sentry-ruby'
# May raise exception if Sentry not ready
Sentry.with_child_span do |child_span|
# ...
end
Expected Behavior
Ignore the span until Sentry is ready.
Actual Behavior
Raised UndefinedMethod error
Ruby Version
2.7.6
SDK Version
5.3.0
Integration and Its Version
Sequel
Sentry Config
No response
Issue Description
sentry-ruby/sentry-ruby/lib/sentry-ruby.rb
Lines 401 to 420 in 0fe8d27
The
get_current_scopewill returnnilbefore initialized then thewith_child_spanwill failed.Reproduction Steps
Expected Behavior
Ignore the span until Sentry is ready.
Actual Behavior
Raised
UndefinedMethoderrorRuby Version
2.7.6
SDK Version
5.3.0
Integration and Its Version
Sequel
Sentry Config
No response