From bd329e98ef05e353a558fa089f8d18beb7a8268b Mon Sep 17 00:00:00 2001 From: Arjun Rajappa Date: Tue, 11 Nov 2025 21:57:49 +0530 Subject: [PATCH] Fix: breaking application logic because the supe call was being made 1. If tracer was disabled or if the agent was not ready the checks would return false and the methoud would return without calling the super class in_span This overriden in_span method can be safly removed as the same checks are in place (inside start_span) Closes 478 Signed-off-by: Arjun Rajappa --- lib/instana/trace/tracer.rb | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/lib/instana/trace/tracer.rb b/lib/instana/trace/tracer.rb index 574ca51d..ebb89d72 100644 --- a/lib/instana/trace/tracer.rb +++ b/lib/instana/trace/tracer.rb @@ -307,27 +307,6 @@ def clear! self.current_span = nil end - # Creates a span that is active during the execution of the provided block. - # The span is automatically closed when the block completes, whether it completes - # normally or with an exception. - # - # @param name [String, Symbol] the name of the span to create - # @param attributes [Hash, nil] optional attributes to set on the span - # @param links [Array, nil] optional links to associate with the span - # @param start_timestamp [Integer, nil] optional start time for the span in milliseconds - # @param kind [Symbol, nil] optional span kind (e.g., :internal, :client, :server) - # - # @return [Object] the return value of the block - # - # @note This method is a wrapper around the parent class implementation and - # will only create a span if the Instana agent is ready and tracing is enabled. - # - def in_span(name, attributes: nil, links: nil, start_timestamp: nil, kind: nil) - return if !::Instana.agent.ready? || !::Instana.config[:tracing][:enabled] - - super - end - # Starts a new span with the given parameters. # # @param name [String, Symbol] the name of the span to create (defaults to 'empty' if nil)